Exemplo n.º 1
0
        public static async Task <OneDriveProvider> Instance(OneDriveAccount acc)
        {
            var provider = new OneDriveProvider();
            await provider.Authenticate(acc);

            return(provider);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the appropriate authenticated provider based on the parameters
        /// </summary>
        /// <param name="providerType">Service provider</param>
        /// <param name="acc">User account</param>
        /// <returns></returns>
        private static async Task <IFileTransferProvider> getProvider(ServiceProviders providerType, Account acc)
        {
            IFileTransferProvider retval = null;

            switch (providerType)
            {
            case ServiceProviders.Local:
                retval = LocalStorageProvider.Instance();
                break;

            case ServiceProviders.Google:
                retval = await GoogleDriveProvider.Instance(acc as GoogleDriveAccount);

                break;

            case ServiceProviders.DropBox:
                retval = await DropBoxProvider.Instance(acc as DropBoxAccount);

                break;

            case ServiceProviders.OneDrive:
                retval = await OneDriveProvider.Instance(acc as OneDriveAccount);

                break;

            case ServiceProviders.SSH:
                retval = await SSHProvider.Instance(acc as SSHAccount);

                break;
            }
            return(retval);
        }