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


C# IPackageSourceProvider.SavePackageSources方法代码示例

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


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

示例1: PersistPackageSources

        private static void PersistPackageSources(IPackageSourceProvider packageSourceProvider, IVsShellInfo vsShellInfo, List<PackageSource> packageSources)
        {
            // When running Visual Studio Express For Windows 8, we will have previously swapped in a curated package source for the normal official source.
            // But, we always want to persist the normal official source. So, we swap the normal official source back in for the curated source.
            if (vsShellInfo.IsVisualStudioExpressForWindows8)
            {
                packageSources = packageSources.Select(packageSource => packageSource.IsOfficial ?
                    new PackageSource(NuGetConstants.DefaultFeedUrl, OfficialFeedName, isEnabled: packageSource.IsEnabled, isOfficial: true) :
                    packageSource)
                    .ToList();
            }

            // Starting from version 1.3, we persist the package sources to the nuget.config file instead of VS registry.
            // assert that we are not saving aggregate source
            Debug.Assert(!packageSources.Any(p => IsAggregateSource(p.Name, p.Source)));
            packageSourceProvider.SavePackageSources(packageSources);
        }
开发者ID:xero-github,项目名称:Nuget,代码行数:17,代码来源:VSPackageSourceProvider.cs

示例2: PersistPackageSources

        private static void PersistPackageSources(IPackageSourceProvider packageSourceProvider, IVsShellInfo vsShellInfo, List<PackageSource> packageSources)
        {
            bool windows8SourceIsDisabled = false;

            // When running Visual Studio Express For Windows 8, we will have previously added a curated package source.
            // But we don't want to persist it, so remove it from the list.
            if (vsShellInfo.IsVisualStudioExpressForWindows8)
            {
                PackageSource windows8SourceInUse = packageSources.Find(p => p.Equals(Windows8Source));
                Debug.Assert(windows8SourceInUse != null);
                if (windows8SourceInUse != null)
                {
                    packageSources = packageSources.Where(ps => !ps.Equals(Windows8Source)).ToList();
                    windows8SourceIsDisabled = !windows8SourceInUse.IsEnabled;
                }
            }

            // Starting from version 1.3, we persist the package sources to the nuget.config file instead of VS registry.
            // assert that we are not saving aggregate source
            Debug.Assert(!packageSources.Any(p => IsAggregateSource(p.Name, p.Source)));
            
            packageSourceProvider.SavePackageSources(packageSources);

            if (windows8SourceIsDisabled)
            {
                packageSourceProvider.DisablePackageSource(Windows8Source);
            }
        }
开发者ID:kumavis,项目名称:NuGet,代码行数:28,代码来源:VSPackageSourceProvider.cs

示例3: PersistPackageSources

 private static void PersistPackageSources(IPackageSourceProvider packageSourceProvider, IVsShellInfo vsShellInfo, List<PackageSource> packageSources)
 {
     // Starting from version 1.3, we persist the package sources to the nuget.config file instead of VS registry.
     // assert that we are not saving aggregate source
     Debug.Assert(!packageSources.Any(p => IsAggregateSource(p.Name, p.Source)));
     
     packageSourceProvider.SavePackageSources(packageSources);
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:8,代码来源:VSPackageSourceProvider.cs


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