using PDF_Office.Model.CloudDrive;
using PDF_Office.ViewModels.HomePanel.CloudDrive.CloudDriveType;
using Prism.Commands;
using Prism.Mvvm;
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 CloudFilesContentViewModel : BindableBase
    {
     
        public GoogleDriveManager GoogleDrive => GoogleDriveManager.GoogleDrive;
        public DropbBoxManager DropbBox => DropbBoxManager.DropbBox;
        public DelegateCommand OpenCloudDriveCommand { get; set; }
        public DelegateCommand CheckDriveUsersCommand { get; set; }

        public DelegateCommand<CloudBoxItem> CheckDriveCommand { get; set; }
        
        public CloudFilesContentViewModel()
        {
            OpenCloudDriveCommand = new DelegateCommand(OpenCloudDrive_Click);
            OpenCloudDriveCommand = new DelegateCommand(CheckDriveUsers);

            CheckDriveCommand = new DelegateCommand<CloudBoxItem>(CheckDrive);
        }

        public async void CheckDrive(CloudBoxItem cloudDriveItem)
        {
            switch (cloudDriveItem.CloudDiskType)
            {
                case CloudType.GoogleDrive:
                     await GoogleDrive.LoginUserCount();
                    break;
                case CloudType.DropBox:
                     await DropbBox.LoginUser();
                    break;
            }
        }

        #region 云盘公用接口

        public async void CheckDriveUsers()
        {
            //   var result = await GetHistoryUser();
            //    isFoundUserHandler?.Invoke(null, result);
         // await  GoogleDrive.LoginUderCount();

        }

        #endregion
        public void OpenCloudDrive_Click()
        {

        }


        #region 谷歌云盘

        public void LoginUser_Click()
        {

        }

        public async Task<bool> GetHistoryUser()
        {
            bool isFound = false;

            //if (await GoogleDrive.GetHistoryUsers())
            //{
            //    isFound = true;
            //}
            return isFound;

        }

        #endregion




        #region 用户帐号

        /// <summary>
        /// 登录
        /// </summary>
        public void LoginUser()
        {
           
        }

        /// <summary>
        /// 移除用户
        /// </summary>
        public void RemoveUser()
        {

        }

        /// <summary>
        /// 切换用户
        /// </summary>
        public void SwitchUser()
        {

        }


        #endregion


        #region 文件
        
        public void GetFiles()
        {

        }

        public void GetFolders()
        {

        }

        public void UpLoad()
        {

        }
        #endregion

    }
}
