using PDF_Office.Model.CloudDrive; using PDF_Office.ViewModels.HomePanel.CloudDrive.CloudDriveType; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PDF_Office.ViewModels.HomePanel.CloudDrive { //各云盘的管理类 //单实例化 public class CloudDriveManager { public GoogleDriveManager GoogleDrive => GoogleDriveManager.GoogleDrive; public DropbBoxManager DropbBox => DropbBoxManager.DropbBox; public CloudType cloudType; private static CloudDriveManager instance; public static CloudDriveManager GetInstance() { if (instance == null) instance = new CloudDriveManager(); return instance; } private CloudDriveManager() { } #region 用户帐号 /// /// 登录 /// public async Task LoginUser(CloudType cloudType) { switch(cloudType) { case CloudType.GoogleDrive: return await GoogleDrive.LoginUserCount(); case CloudType.DropBox: return await DropbBox.LoginUser(); } return false; } public bool LoadedUsers() { bool isUsers = false; if (Cloud.CloudLists.Count > 0) isUsers = true; return isUsers; } /// /// 移除用户 /// public async Task RemoveUser() { GoogleDriveUserItem userIttem = null; switch (cloudType) { case CloudType.OneDrive: return await GoogleDrive.RemoveUser(userIttem); } return false; } /// /// 切换用户 /// public void SwitchUser() { } #endregion #region 文件 public void GetFiles() { } public void GetFolders() { } public void UpLoad() { } #endregion } }