CloudFilesContentViewModel.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using PDF_Office.Model.CloudDrive;
  2. using PDF_Office.ViewModels.HomePanel.CloudDrive.CloudDriveType;
  3. using Prism.Commands;
  4. using Prism.Mvvm;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace PDF_Office.ViewModels.HomePanel.CloudDrive
  12. {
  13. //各云盘事件
  14. public class CloudFilesContentViewModel : BindableBase
  15. {
  16. public GoogleDriveManager GoogleDrive => GoogleDriveManager.GoogleDrive;
  17. public DropbBoxManager DropbBox => DropbBoxManager.DropbBox;
  18. public DelegateCommand OpenCloudDriveCommand { get; set; }
  19. public DelegateCommand CheckDriveUsersCommand { get; set; }
  20. public DelegateCommand<CloudBoxItem> CheckDriveCommand { get; set; }
  21. public CloudFilesContentViewModel()
  22. {
  23. OpenCloudDriveCommand = new DelegateCommand(OpenCloudDrive_Click);
  24. OpenCloudDriveCommand = new DelegateCommand(CheckDriveUsers);
  25. CheckDriveCommand = new DelegateCommand<CloudBoxItem>(CheckDrive);
  26. }
  27. public async void CheckDrive(CloudBoxItem cloudDriveItem)
  28. {
  29. switch (cloudDriveItem.CloudDiskType)
  30. {
  31. case CloudType.GoogleDrive:
  32. await GoogleDrive.LoginUserCount();
  33. break;
  34. case CloudType.DropBox:
  35. await DropbBox.LoginUser();
  36. break;
  37. }
  38. }
  39. #region 云盘公用接口
  40. public async void CheckDriveUsers()
  41. {
  42. // var result = await GetHistoryUser();
  43. // isFoundUserHandler?.Invoke(null, result);
  44. // await GoogleDrive.LoginUderCount();
  45. }
  46. #endregion
  47. public void OpenCloudDrive_Click()
  48. {
  49. }
  50. #region 谷歌云盘
  51. public void LoginUser_Click()
  52. {
  53. }
  54. public async Task<bool> GetHistoryUser()
  55. {
  56. bool isFound = false;
  57. //if (await GoogleDrive.GetHistoryUsers())
  58. //{
  59. // isFound = true;
  60. //}
  61. return isFound;
  62. }
  63. #endregion
  64. #region 用户帐号
  65. /// <summary>
  66. /// 登录
  67. /// </summary>
  68. public void LoginUser()
  69. {
  70. }
  71. /// <summary>
  72. /// 移除用户
  73. /// </summary>
  74. public void RemoveUser()
  75. {
  76. }
  77. /// <summary>
  78. /// 切换用户
  79. /// </summary>
  80. public void SwitchUser()
  81. {
  82. }
  83. #endregion
  84. #region 文件
  85. public void GetFiles()
  86. {
  87. }
  88. public void GetFolders()
  89. {
  90. }
  91. public void UpLoad()
  92. {
  93. }
  94. #endregion
  95. }
  96. }