public MicrosoftAccountHandler(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { Scopes = new[] { APPIDURI_MSGRAPH + "User.Read.All", }; }
public MainViewModel(IPasswordVaultService passwordVaultService) { _passwordVaultService = passwordVaultService; }
private static IEnumerable <PackageHandlerBase> InstantiateAllPackageHandlers(Assembly pluginAssembly, ISettingsService settings, IPasswordVaultService passwordVaultService) { object[] ctorArgs = new object[] { passwordVaultService }; foreach (Type type in pluginAssembly.GetTypes() .Where(t => t.BaseType.IsAssignableTo(typeof(PackageHandlerBase)) && t.IsPublic)) { var ctr = type.GetConstructor(_ctorTypeList); if (ctr == null) { continue; } // Create a new instance of the handler var handler = (PackageHandlerBase)ctr.Invoke(ctorArgs); if (handler == null) { continue; } // Enable or disable according to user settings handler.IsEnabled = settings.GetPackageHandlerEnabledState(type.Name); // Pass services to handler ((IHandler)handler).SetServices(pkgSvc, accSvc); // Register handler with the type name as its ID yield return(handler); } }
public PackageHandlerBase(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { }
/// <summary> /// Attempts to load all plugins located in <see cref="ISettingsService.PluginDirectory"/> /// and registers all loaded package handlers with the provided <paramref name="packageHandlers"/>. /// </summary> /// <param name="packageHandlers">The dictionary to add loaded package handlers to.</param> public static PluginLoadResult LoadPlugins(ISettingsService settings, IPasswordVaultService passwordVaultService) { PluginLoadResult result = new(); // Make sure that the runtime looks for plugin dependencies // in the plugin's folder. AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += LoadFromSameFolder; foreach (string pluginInfoPath in Directory.EnumerateFiles(settings.PluginDirectory, "*.txt", SearchOption.AllDirectories)) { // The plugin info file is a plain text file where each line is // a relative path to the DLLs containing the actual implementation. // This is to avoid unnecessarily loading and searching for package // handlers in DLLs that are only for dependencies (and also serves // to prevent loading the same plugin twice, if one plugin depends // on another. string pluginPath = Path.GetDirectoryName(pluginInfoPath); string[] dllRelativePaths = File.ReadAllLines(pluginInfoPath); foreach (string dllRelativePath in dllRelativePaths) { string assemblyPath = Path.Combine(pluginPath, dllRelativePath); if (string.IsNullOrWhiteSpace(assemblyPath)) { continue; } try { // Load assembly and consider only types that inherit from PackageHandlerBase // and are public. var assembly = Assembly.LoadFile(assemblyPath); foreach (PackageHandlerBase handler in InstantiateAllPackageHandlers(assembly, settings, passwordVaultService)) { // Register handler result.PackageHandlers.Add(handler); } } catch (Exception ex) { #if DEBUG System.Diagnostics.Debug.WriteLine(ex); #endif continue; } } } // Pass loaded handlers to respective services accSvc.AccountHandlers = result.AccountHandlers; pkgSvc.PackageHandlers = result.PackageHandlers; // Call OnLoaded method on all handlers IHandler[] handlers = result.AccountHandlers.OfType <IHandler>().Concat(result.PackageHandlers.Values.OfType <IHandler>()).ToArray(); foreach (var handler in handlers) { handler.OnLoaded(); } return(result); }
public FluentStoreHandler(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { AccountHandler = new Users.FluentStoreAccountHandler(FSApi, passwordVaultService); }
public GitHubAccountHandler(GitHubClient client, CredentialStore credentialStore, IPasswordVaultService passwordVaultService) : base(passwordVaultService) { _client = client; _credentialStore = credentialStore; }
public UwpCommunityHandler(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { // TODO: Create UWPC account handler //AccountHandler = new Users.UwpCommunityAccountHandler(passwordVaultService); }
public FluentStoreAccountHandler(FluentStoreAPI.FluentStoreAPI fsApi, IPasswordVaultService passwordVault) : base(passwordVault) { FSApi = fsApi; }
public AccountHandlerBase(IPasswordVaultService passwordVaultService) { _passwordVaultService = passwordVaultService; }
public MainViewModel(IPasswordVaultService passwordVaultService) { _passwordVaultService = passwordVaultService; }
public AuthService() { _passwordVaultService = App.Container.GetRequiredService <IPasswordVaultService>(); }
protected OpenIDAccountHandler(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { }
public ChocolateyHandler(IPasswordVaultService passwordVaultService) : base(passwordVaultService) { }