/// <summary>
        /// For DropBox
        /// </summary>
        /// <param name="events"></param>
        /// <param name="requestToken"></param>
        public DropBoxProfile(IEventAggregator events,
                              string clientId, string clientSecret,
                              Func <UserLogin> loginFunc,
                              string aliasMask = "{0}'s DropBox")
            : base(events)
        {
            ProfileName = "DropBox";
            ProfileIcon = ResourceUtils.GetEmbeddedResourceAsByteArray(this, "/Model/DropBox/DropBox_Logo.png");
            ModelCache  = new EntryModelCache <DropBoxItemModel>(m => m.FullPath, () => Alias, true);
            //_accessToken = accessToken;
            Path          = PathHelper.Web;
            _loginFunc    = loginFunc;
            _clientId     = clientId;
            _clientSecret = clientSecret;
            _aliasMask    = aliasMask;

            _thumbnailExtractor = new DropBoxModelThumbnailExtractor(() => GetClient());


            DiskIO            = new DropBoxDiskIOHelper(this);
            HierarchyComparer = PathComparer.WebDefault;
            MetadataProvider  = new DropBoxMetadataProvider(() => GetClient());
            //CommandProviders = new List<ICommandProvider>();
            SuggestSource = new NullSuggestSource();
            //PathMapper = new SkyDriveDiskPathMapper(this, null);
            DragDrop = new FileBasedDragDropHandler(this);
        }
Exemple #2
0
        private async Task checkLoginAsync()
        {
            if (_driveService == null)
            {
                _driveService = new Google.Apis.Drive.v2.DriveService(
                    new BaseClientService.Initializer()
                {
                    HttpClientInitializer = _credential,
                    ApplicationName       = "FileExplorer",
                    //ApiKey = clientId
                });
                _aboutInfo = await _driveService.About.Get().ExecuteAsync();

                Alias           = String.Format(_aliasMask, _aboutInfo.User.DisplayName);
                ModelCache      = new EntryModelCache <GoogleDriveItemModel>(m => m.UniqueId, () => Alias, true);
                MimeTypeManager = new GoogleMimeTypeManager(_aboutInfo);
            }
        }
 public SkyDriveProfile(IEventAggregator events, string clientId, Func <string> authCodeFunc,
                        string aliasMask      = "{0}'s SkyDrive",
                        string rootAccessPath = "/me/skydrive")
     : base(events)
 {
     ProfileName       = "SkyDrive";
     ProfileIcon       = ResourceUtils.GetEmbeddedResourceAsByteArray(this, "/Model/SkyDrive/OneDrive_Logo.png");
     ModelCache        = new EntryModelCache <SkyDriveItemModel>(m => m.UniqueId, () => Alias, true);
     Alias             = "SkyDrive";
     _aliasMask        = aliasMask;
     Path              = PathHelper.Web;
     DiskIO            = new SkyDriveDiskIOHelper(this);
     HierarchyComparer = PathComparer.WebDefault;
     MetadataProvider  = new SkyDriveMetadataProvider();
     CommandProviders  = new List <ICommandProvider>();
     SuggestSource     = new NullSuggestSource();
     //PathMapper = new SkyDriveDiskPathMapper(this, null);
     DragDrop        = new FileBasedDragDropHandler(this);
     _authClient     = new LiveAuthClient(clientId);
     _authCodeFunc   = authCodeFunc;
     _rootAccessPath = rootAccessPath;
 }