当前位置: 首页>>代码示例>>C#>>正文


C# IPackageRepositoryFactory.CreateRepository方法代码示例

本文整理汇总了C#中IPackageRepositoryFactory.CreateRepository方法的典型用法代码示例。如果您正苦于以下问题:C# IPackageRepositoryFactory.CreateRepository方法的具体用法?C# IPackageRepositoryFactory.CreateRepository怎么用?C# IPackageRepositoryFactory.CreateRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackageRepositoryFactory的用法示例。


在下文中一共展示了IPackageRepositoryFactory.CreateRepository方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAggregate

        public static IPackageRepository GetAggregate(this IPackageSourceProvider provider, IPackageRepositoryFactory factory, bool ignoreFailingRepositories, IEnumerable<string> feeds)
        {
            Func<string, IPackageRepository> createRepository = factory.CreateRepository;

            if (ignoreFailingRepositories)
            {
                createRepository = (source) =>
                {
                    try
                    {
                        return factory.CreateRepository(source);
                    }
                    catch (InvalidOperationException)
                    {
                        return null;
                    }
                };
            }

            var repositories = (from item in feeds
                                let repository = createRepository(provider.ResolveSource(item))
                                where repository != null
                                select repository).ToArray();
            return new AggregateRepository(repositories) { IgnoreFailingRepositories = ignoreFailingRepositories };
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:25,代码来源:PackageSourceProviderExtensions.cs

示例2: PackageDownloadingService

 public PackageDownloadingService(IAgentSettingsManager agentSettingsManager,
     IRetrievePackageQuery allPackagesQuery,
     ILocalPackageCache agentCache,
     IAgentConfigurationManager agentConfigurationManager,
     ILogger logger,
     IHubCommunicator hubCommunicator,
     IInstalledPackageArchive installCache,
     IPackageRepositoryFactory packageRepositoryFactory,
     IPackagesList allPackagesList,
     ICurrentlyDownloadingList currentlyDownloadingList,
     CompletedInstallationTaskList installationResults,
     IAgentWatchList watchList,
     IInstallationManager installationManager,INotificationService notificationService)
 {
     _settingsManager = agentSettingsManager;
     AllPackagesQuery = allPackagesQuery;
     AgentCache = agentCache;
     _agentConfigurationManager = agentConfigurationManager;
     _logger = logger;
     _hubCommunicator = hubCommunicator;
     _installCache = installCache;
     _packageRepository = packageRepositoryFactory.CreateRepository(agentSettingsManager.Settings.NuGetRepository);
     _allPackagesList = allPackagesList;
     _currentlyDownloadingList = currentlyDownloadingList;
     _installationResults = installationResults;
     _watchList = watchList;
     _installationManager = installationManager;
     _notificationService = notificationService;
     TimedTask = new TimedSingleExecutionTask(agentSettingsManager.Settings.PackageSyncIntervalMs, FetchPackages,
                                              _logger);
 }
开发者ID:andrewmyhre,项目名称:DeployD,代码行数:31,代码来源:PackageDownloadingService.cs

示例3: CreateRepository

            private static IPackageRepository CreateRepository(IPackageRepositoryFactory repositoryFactory, PackageSource packageSource)
            {
                IPackageRepository packageRepository = repositoryFactory.CreateRepository(packageSource);
                var httpClientEvents = packageRepository as IHttpClientEvents;

                if (httpClientEvents != null) {
                    httpClientEvents.SendingRequest += (sender, args) => {
                        string userAgent = HttpUtility.CreateUserAgentString(UserAgentClient);
                        HttpUtility.SetUserAgent(args.Request, userAgent);
                    };
                }

                return packageRepository;
            }
开发者ID:grendello,项目名称:nuget,代码行数:14,代码来源:CommandLineRepositoryFactory.cs

示例4: PackageRepositoryBrowser

        public PackageRepositoryBrowser(ISourceRepositoryProvider sourceRepositoryProvider, IPackageRepositoryFactory packageRepositoryFactory)
        {
            if (sourceRepositoryProvider == null)
            {
                throw new ArgumentNullException("sourceRepositoryProvider");
            }

            if (packageRepositoryFactory == null)
            {
                throw new ArgumentNullException("packageRepositoryFactory");
            }

            this.repositoryConfigurations = sourceRepositoryProvider.GetRepositoryConfigurations().ToArray();
            this.repositories = this.repositoryConfigurations.Select(r => packageRepositoryFactory.CreateRepository(r.Url.ToString())).ToArray();
        }
开发者ID:andreaskoch,项目名称:NuDeploy,代码行数:15,代码来源:PackageRepositoryBrowser.cs

示例5: LazyRepository

 public LazyRepository(IPackageRepositoryFactory factory, PackageSource source)
 {
     _repository = new Lazy<IPackageRepository>(() => factory.CreateRepository(source.Source));
 }
开发者ID:monoman,项目名称:NugetCracker,代码行数:4,代码来源:LazyRepository.cs

示例6: RetrieveNuGetPackageQuery

 public RetrieveNuGetPackageQuery(IPackageRepositoryFactory packageRepositoryFactory, FeedLocation feedLocation, ILogger logger)
 {
     _packageRepositoryFactory = packageRepositoryFactory;
     _logger = logger;
     _packageRepository = _packageRepositoryFactory.CreateRepository(feedLocation.Source);
 }
开发者ID:andrewmyhre,项目名称:DeployD,代码行数:6,代码来源:RetrieveNuGetPackageQuery.cs


注:本文中的IPackageRepositoryFactory.CreateRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。