private static LoginViewModel CreateSut( IHudUtility hudUtility = null, IAlertUtility alertUtility = null, ICredentialStorage credentialStorage = null, ICredentialValidator credentialValidator = null, IBackgroundSyncUtility backgroundSync = null ) { if (credentialValidator == null) { credentialValidator = Substitute.For <ICredentialValidator>(); credentialValidator.ValidateAsync(Arg.Any <Credentials>()) .Returns(Task.FromResult(Result.Success)); } if (credentialStorage == null) { credentialStorage = Substitute.For <ICredentialStorage>(); credentialStorage.SaveCredentialsAsync(Arg.Any <Credentials>()) .Returns(Task.FromResult(Result.Success)); } return(new LoginViewModel( credentialValidator, credentialStorage, hudUtility ?? Substitute.For <IHudUtility>(), alertUtility ?? Substitute.For <IAlertUtility>(), backgroundSync ?? Substitute.For <IBackgroundSyncUtility>() )); }
public SmartJuickClient(ICredentialStorage credentialStorage) { var credential = credentialStorage.LoadCredential(); if(credential != null) { SetCredential(credential); } }
public SmartJuickClient(ICredentialStorage credentialStorage) { var credential = credentialStorage.LoadCredential(); if (credential != null) { SetCredential(credential); } }
public DiscordClient(IMessageBus messageBus, ICredentialStorage credentialStorage) { _messageBus = messageBus; DISCORD_BOT_KEY = credentialStorage.GetKey("discord", null); _discordClient = new DiscordSocketClient(new DiscordSocketConfig() { MessageCacheSize = 150, DefaultRetryMode = RetryMode.AlwaysRetry, }); }
public ConfigManager(ICredentialStorage credentialStorage, IFileSystem fileSystem) { _credentialStorage = credentialStorage; _fileSystem = fileSystem; _localConfigPath = _fileSystem.Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Programs", "Worms", "local.json"); }
/// <summary> /// Выполняет установку новых креденций /// </summary> /// <param name="args"></param> public static void Main(string[] args) { Storage = Applications.Application.Current.Container.Get<ICredentialStorage>(); if (null == Storage) { throw new Exception("no storage provided"); } if (0 == args.Length) { ExecuteInteractive(); } else { ExecuteNonInteractive(args); } }
/// <summary> /// Initializes a new instance of the <see cref="ViewModel"/> class. /// </summary> public ViewModel() { this.credentialStorage = new AppCredentialStorage(); var googleAuth = new GoogleAuthenticator(this.credentialStorage) { LogToConsole = this.Log }; var facebookAuth = new FacebookAuthenticator(this.credentialStorage) { LogToConsole = this.Log }; this.authenticationTypes = new List <AuthenticationType> { new AuthenticationType { Name = "None" }, new AuthenticationType { Name = facebookAuth.Name, Auth = facebookAuth, Identity = new FacebookIdentity { LogToConsole = this.Log } }, new AuthenticationType { Name = googleAuth.Name, Auth = googleAuth, Identity = new GoogleIdentity { LogToConsole = this.Log } } }; this.selectedType = this.authenticationTypes[0]; this.authenticationStatus = "Not Authenticated"; this.email = "N/A"; this.Log("Application initialized."); if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) { return; } this.Log("This is just a test message."); this.Log("To show the console when the display mode is set to design time enabled, and this is specifically a longer message to make it easier to test that text is wrapping appropriately."); }
public WeatherPlugin(ICredentialStorage credentialStorage) { DARK_SKIES_APIKEY = credentialStorage.GetKey("darkskies", ""); BING_MAPS_APIKEY = credentialStorage.GetKey("bing", ""); try { _userPostcodes = JsonConvert.DeserializeObject <Dictionary <string, string> >(File.ReadAllText(USER_LOCATION_DIR)); } catch { // ignore } }
public LoginViewModel(IJuickClient juickClient, ICredentialStorage credentialStorage, INavigationManager navigationManager) { this.client = juickClient; this.credentialStorage = credentialStorage; this.navigationManager = navigationManager; LoginCommand = new DelegateCommand(DoLogin); var credential = credentialStorage.LoadCredential(); if(credential != null) { login = credential.UserName; password = credential.Password; } }
public LoginViewModel( ICredentialValidator credentialValidator, ICredentialStorage credentialStorage, IHudUtility hud, IAlertUtility alerts, IBackgroundSyncUtility backgroundSync ) { _credentialValidator = credentialValidator; _credentialStorage = credentialStorage; _hud = hud; _alerts = alerts; _backgroundSync = backgroundSync; }
/// <summary> /// Returns either the type of the Course List Page (when the user is already /// authenticated) or of the Login Page (when the user isn't authenticated). /// </summary> internal static async Task <Type> InitializeAsync( ICredentialStorage credentialStorage, IBackgroundSyncUtility backgroundSync ) { var credentialsResult = await credentialStorage.GetCredentialsAsync().ConfigureAwait(false); if (credentialsResult.IsSuccessful) { backgroundSync.Enable(); } return(credentialsResult.IsSuccessful ? typeof(CourseListPage) : typeof(LoginPage)); }
/// <summary> /// Выполняет установку новых креденций /// </summary> /// <param name="args"></param> public static void Main(string[] args) { Storage = Applications.Application.Current.Container.Get <ICredentialStorage>(); if (null == Storage) { throw new Exception("no storage provided"); } if (0 == args.Length) { ExecuteInteractive(); } else { ExecuteNonInteractive(args); } }
public LoginViewModel(IJuickClient juickClient, ICredentialStorage credentialStorage, INavigationManager navigationManager) { this.client = juickClient; this.credentialStorage = credentialStorage; this.navigationManager = navigationManager; LoginCommand = new DelegateCommand(DoLogin); var credential = credentialStorage.LoadCredential(); if (credential != null) { login = credential.UserName; password = credential.Password; } }
protected CredStashBase(ICredentialStorage credentialStorage, IMasterKeyStorage masterKeyStorage, AesCryptoBase aesCrypto) { if (credentialStorage == null) { throw new ArgumentNullException("credentialStorage"); } if (masterKeyStorage == null) { throw new ArgumentNullException("masterKeyStorage"); } if (aesCrypto == null) { throw new ArgumentNullException("aesCrypto"); } CredentialStorage = credentialStorage; MasterKeyStorage = masterKeyStorage; AesCrypto = aesCrypto; }
/// <summary> /// Initializes a new instance of the <see cref="FacebookAuthenticator"/> class. /// </summary> /// <param name="dataStorage"> /// The data storage. /// </param> public FacebookAuthenticator(ICredentialStorage dataStorage) { this.dataStorage = dataStorage; }
public DiscordClient(IMessageBus messageBus, ICredentialStorage credentialStorage) { _messageBus = messageBus; DISCORD_BOT_KEY = credentialStorage.GetKey("discord", null); _discordClient = new DiscordSocketClient(); }
/// <summary> /// Initializes a new instance of the <see cref="GoogleAuthenticator"/> class. /// </summary> /// <param name="dataStorage"> /// The data storage. /// </param> public GoogleAuthenticator(ICredentialStorage dataStorage) { this.dataStorage = dataStorage; this.LogToConsole = delegate { }; }
public CoursePageHtmlDownloader(ICredentialStorage credentialStorage) { _credentialStorage = credentialStorage; }
public Tumblr(ICredentialStorage credentialStorage) { TUMBLR_API_KEY = credentialStorage.GetKey("tumblr", "fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4"); // Public testing API key from Tumblr. }