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_Office.Model.CloudDrive { public class Cloud { public static ObservableCollection CloudLists = new ObservableCollection(); public static List InitCloudBoxs() { List CloudeDrives = new List(); 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 云盘基类 /// /// 用户信息 /// 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; } } /// /// 用户云盘 /// 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 { } /// /// 谷歌云盘的文件 /// public class GoogleDriveFiles: FilesBaseItem { public long? Version { get; set; } } #endregion #region DropbBox /// /// 谷歌云盘的文件 /// public class DropbBoxFiles : FilesBaseItem { public string PathDisplay { get; set; } } public class DropbBoxFolder : FolderBaseItem { } /// /// 指定某云盘某用户,对文件的操作 /// 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 }