예제 #1
0
        private static void AddExtensionsToCatalog(AggregateCatalog catalog, IConsole console)
        {
            var extensionLocator = new ExtensionLocator();
            var files            = extensionLocator.FindExtensions();

            RegisterExtensions(catalog, files, console);
        }
예제 #2
0
        private IEnumerable <NuGet.Credentials.ICredentialProvider> GetCredentialProviders()
        {
            var extensionLocator = new ExtensionLocator();
            var providers        = new List <Credentials.ICredentialProvider>();
            var pluginProviders  = new PluginCredentialProviderBuilder(extensionLocator, Settings).BuildAll();

            providers.Add(new CredentialProviderAdapter(new SettingsCredentialProvider(SourceProvider, Console)));
            providers.AddRange(pluginProviders);
            providers.Add(new ConsoleCredentialProvider(Console));

            return(providers);
        }
예제 #3
0
        private IEnumerable <NuGet.Credentials.ICredentialProvider> GetCredentialProviders()
        {
            var extensionLocator = new ExtensionLocator();
            var providers        = new List <Credentials.ICredentialProvider>();
            var pluginProviders  = new PluginCredentialProviderBuilder(extensionLocator, Settings).BuildAll().ToList();

            providers.Add(new CredentialProviderAdapter(new SettingsCredentialProvider(SourceProvider, Console)));
            if (pluginProviders.Any())
            {
                providers.AddRange(pluginProviders);
                if (PreviewFeatureSettings.DefaultCredentialsAfterCredentialProviders)
                {
                    providers.Add(new DefaultCredentialsCredentialProvider());
                }
            }
            providers.Add(new ConsoleCredentialProvider(Console));

            return(providers);
        }
예제 #4
0
        private async Task <IEnumerable <ICredentialProvider> > GetCredentialProvidersAsync()
        {
            var extensionLocator = new ExtensionLocator();
            var providers        = new List <ICredentialProvider>();
            var pluginProviders  = new PluginCredentialProviderBuilder(extensionLocator, Settings, Console)
                                   .BuildAll(Verbosity.ToString())
                                   .ToList();
            var securePluginProviders = await(new SecurePluginCredentialProviderBuilder(PluginManager.Instance, canShowDialog: true, logger: Console)).BuildAllAsync();

            providers.Add(new CredentialProviderAdapter(new SettingsCredentialProvider(SourceProvider, Console)));
            providers.AddRange(securePluginProviders);
            providers.AddRange(pluginProviders);

            if (pluginProviders.Any() || securePluginProviders.Any())
            {
                if (PreviewFeatureSettings.DefaultCredentialsAfterCredentialProviders)
                {
                    providers.Add(new DefaultNetworkCredentialsCredentialProvider());
                }
            }
            providers.Add(new ConsoleCredentialProvider(Console));

            return(providers);
        }