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 用户帐号

        /// <summary>
        /// 登录
        /// </summary>
        public async Task<bool> 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;

        }
        /// <summary>
        /// 移除用户
        /// </summary>
        public async Task<bool> RemoveUser()
        {
            GoogleDriveUserItem userIttem = null;
            switch (cloudType)
            {
                case CloudType.OneDrive:
                    return await GoogleDrive.RemoveUser(userIttem);
            }
            return false;
        }

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

        }


        #endregion


        #region 文件

        public void GetFiles()
        {

        }

        public void GetFolders()
        {

        }

        public void UpLoad()
        {

        }
        #endregion

    }
}
