private WsAccountAccessor(WsAccount account, TcUIProvider uiProvider, WsApiClient apiClient) : base(account.UserName, FileAttributes.Directory)
 {
     _account           = account;
     _uiProvider        = uiProvider;
     _apiClient         = apiClient;
     _secretStore       = new TcSecretStore(account, _uiProvider);
     _filesPreviewCache = new WsFilePreviewCache();
 }
 public static bool TryRegisterAccount(WsAccountRepository accountRepository, TcUIProvider uiProvider, WsAccountLoginInfo userCredential, out WsAccountAccessor accountAccessor)
 {
     WsAccountRepository.SuccessAccountRegistrationInfo successRegistration;
     using (ThreadKeeper exec = new ThreadKeeper())
     {
         successRegistration = exec.ExecAsync((cancellationToken) => accountRepository.TryRegisterAccount(userCredential));
     }
     if (successRegistration != null)
     {
         accountAccessor = new WsAccountAccessor(successRegistration.Account, uiProvider, successRegistration.ConnectedApiClient);
         return(true);
     }
     accountAccessor = null;
     return(false);
 }
Exemplo n.º 3
0
 public WsFsPlugin(Settings pluginSettings) : base(pluginSettings)
 {
     _uiProvider        = new TcUIProvider(this.Prompt);
     _accountRepository = new WsAccountCollection(_uiProvider);
     Title = "WebShare.cz";
 }
 public WsAccountCollection(TcUIProvider uiProvider)
 {
     _uiProvider        = uiProvider;
     _accountRepository = new WsAccountRepository(new TcDataProtector(), "TotalCommander");
     _accountAccessors  = new List <WsAccountAccessor>(_accountRepository.Select(a => new WsAccountAccessor(a, uiProvider, _accountRepository.GetDeviceUuid())).ToArray());
 }
Exemplo n.º 5
0
 public TcSecretStore(WsAccount account, TcUIProvider uiProvider)
 {
     _account    = account;
     _uiProvider = uiProvider;
 }
 public WsAccountAccessor(WsAccount account, TcUIProvider uiProvider, Guid deviceUuid) : this(account, uiProvider, new WsApiClient(deviceUuid))
 {
 }