123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- using Google.Apis.Auth.OAuth2;
- using Google.Apis.Drive.v3;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PDF_Master.Model.CloudDrive
- {
- public class Cloud
- {
- public static ObservableCollection<UserBaseItem> CloudLists = new ObservableCollection<UserBaseItem>();
- public static List<CloudBoxItem> InitCloudBoxs()
- {
- List<CloudBoxItem> CloudeDrives = new List<CloudBoxItem>();
- var cloudDriveItem = new CloudBoxItem(CloudType.Box);
- CloudeDrives.Add(cloudDriveItem);
- cloudDriveItem = new CloudBoxItem(CloudType.DropBox);
- CloudeDrives.Add(cloudDriveItem);
- cloudDriveItem = new CloudBoxItem(CloudType.GoogleDrive);
- CloudeDrives.Add(cloudDriveItem);
- cloudDriveItem = new CloudBoxItem(CloudType.OneDrive);
- CloudeDrives.Add(cloudDriveItem);
- return CloudeDrives;
- }
- }
- #region 云盘基类
- /// <summary>
- /// 用户信息
- /// </summary>
- public class UserInfo
- {
- public string Name { get; set; }
- public int Id { get; set; }
- public string UserAccount { get; set; }
- }
- public class FolderBaseItem
- {
- public FileOperation Operation { get; set; }
- public int Level { get; set; }
- public string FolderName { get; set; }
- }
- /// <summary>
- /// 用户云盘
- /// </summary>
- public class UserBaseItem
- {
- public UserInfo userInfo { get; set; }
- public CloudType cloudType { get; set; }
- }
- public class FilesBaseItem
- {
- public string Id { get; set; }
- public bool IsFolder { get; set; }
- public int Level { get; set; }
- public string Name { get; set; }
- public string MimeType { get; set; }
- public long? Size { get; set; }
- public DateTime? CreatedTime { get; set; }
- }
- #endregion
- #region GooglrDrive
- //文件夹
- public class GoogleDriveFolder: FolderBaseItem
- {
-
-
- }
- /// <summary>
- /// 谷歌云盘的文件
- /// </summary>
- public class GoogleDriveFiles: FilesBaseItem
- {
- public long? Version { get; set; }
- }
- #endregion
- #region DropbBox
- /// <summary>
- /// 谷歌云盘的文件
- /// </summary>
- public class DropbBoxFiles : FilesBaseItem
- {
- public string PathDisplay { get; set; }
- }
- public class DropbBoxFolder : FolderBaseItem
- {
- }
- /// <summary>
- /// 指定某云盘某用户,对文件的操作
- /// </summary>
- public class FileOperation
- {
- public string SourceFileName { get; set; }
- public string SourceFile { get; set; }
- public UserBaseItem User { get; set; }
- public FilesBaseItem DoFile { get; set; }
- public FileOperation(UserBaseItem user, FilesBaseItem doFile)
- {
- User = user;
- DoFile = doFile;
- }
- }
- #endregion
- }
|