CloudDriveManager.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using PDF_Office.Model.CloudDrive;
  2. using PDF_Office.ViewModels.HomePanel.CloudDrive.CloudDriveType;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PDF_Office.ViewModels.HomePanel.CloudDrive
  9. {
  10. //各云盘的管理类
  11. //单实例化
  12. public class CloudDriveManager
  13. {
  14. public GoogleDriveManager GoogleDrive => GoogleDriveManager.GoogleDrive;
  15. // public DropbBoxManager DropbBox;
  16. public CloudType cloudType;
  17. private static CloudDriveManager instance;
  18. public static CloudDriveManager GetInstance()
  19. {
  20. if (instance == null)
  21. instance = new CloudDriveManager();
  22. return instance;
  23. }
  24. private CloudDriveManager()
  25. {
  26. // DropbBox = new DropbBoxManager();
  27. }
  28. #region 用户帐号
  29. /// <summary>
  30. /// 登录
  31. /// </summary>
  32. public async Task<bool> LoginUser(CloudType cloudType)
  33. {
  34. switch(cloudType)
  35. {
  36. case CloudType.GoogleDrive:
  37. return await GoogleDrive.LoginUserCount();
  38. }
  39. return false;
  40. }
  41. public bool LoadedUsers()
  42. {
  43. bool isUsers = false;
  44. if (CloudFilesContentViewModel.CloudFileUserLists.Count > 0)
  45. isUsers = true;
  46. return isUsers;
  47. }
  48. /// <summary>
  49. /// 移除用户
  50. /// </summary>
  51. public async Task<bool> RemoveUser()
  52. {
  53. GoogleDriveUserItem userIttem = null;
  54. switch (cloudType)
  55. {
  56. case CloudType.OneDrive:
  57. return await GoogleDrive.RemoveUser(userIttem);
  58. }
  59. return false;
  60. }
  61. /// <summary>
  62. /// 切换用户
  63. /// </summary>
  64. public void SwitchUser()
  65. {
  66. }
  67. #endregion
  68. #region 文件
  69. public void GetFiles()
  70. {
  71. }
  72. public void GetFolders()
  73. {
  74. }
  75. public void UpLoad()
  76. {
  77. }
  78. #endregion
  79. }
  80. }