本文整理汇总了C#中IPackageRepository类的典型用法代码示例。如果您正苦于以下问题:C# IPackageRepository类的具体用法?C# IPackageRepository怎么用?C# IPackageRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPackageRepository类属于命名空间,在下文中一共展示了IPackageRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Validate
public IEnumerable<PackageVerifierIssue> Validate(IPackageRepository packageRepo, IPackage package, IPackageVerifierLogger logger)
{
if (!package.IsSatellitePackage())
{
IEnumerable<string> allXmlFiles =
from file in package.GetLibFiles()
select file.Path into path
where path.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)
select path;
foreach (IPackageFile current in package.GetLibFiles())
{
string assemblyPath = current.Path;
// TODO: Does this need to check for just managed code?
if (assemblyPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
{
string docFilePath = Path.ChangeExtension(assemblyPath, ".xml");
if (!allXmlFiles.Contains(docFilePath, StringComparer.OrdinalIgnoreCase))
{
yield return PackageIssueFactory.AssemblyHasNoDocFile(assemblyPath);
}
}
}
}
yield break;
}
示例2: UpdatedPackages
public UpdatedPackages(
IQueryable<IPackage> installedPackages,
IPackageRepository aggregrateRepository)
{
this.installedPackages = installedPackages;
this.sourceRepository = aggregrateRepository;
}
示例3: InstallCommand
protected internal InstallCommand(IPackageRepository cacheRepository) :
base(cacheRepository)
{
// On mono, parallel builds are broken for some reason. See https://gist.github.com/4201936 for the errors
// That are thrown.
DisableParallelProcessing = EnvironmentUtility.IsMonoRuntime;
}
示例4: UninstallWalker
public UninstallWalker(IPackageRepository repository,
IDependentsResolver dependentsResolver,
FrameworkName targetFramework,
ILogger logger,
bool removeDependencies,
bool forceRemove)
: base(targetFramework)
{
if (dependentsResolver == null)
{
throw new ArgumentNullException("dependentsResolver");
}
if (repository == null)
{
throw new ArgumentNullException("repository");
}
if (logger == null)
{
throw new ArgumentNullException("logger");
}
Logger = logger;
Repository = repository;
DependentsResolver = dependentsResolver;
Force = forceRemove;
ThrowOnConflicts = true;
Operations = new Stack<PackageOperation>();
_removeDependencies = removeDependencies;
}
示例5: DependentsWalker
public DependentsWalker(IPackageRepository repository)
{
if (repository == null) {
throw new ArgumentNullException("repository");
}
Repository = repository;
}
示例6: GetActiveProject
public override IPackageManagementProject GetActiveProject(IPackageRepository sourceRepository)
{
if (ExceptionToThrowWhenGetActiveProjectCalled != null) {
throw ExceptionToThrowWhenGetActiveProjectCalled;
}
return base.GetActiveProject(sourceRepository);
}
示例7: UpdateAllPackagesInSolution
public UpdateAllPackagesInSolution(
IPackageManagementSolution solution,
IPackageRepository sourceRepository)
{
this.solution = solution;
this.sourceRepository = sourceRepository;
}
示例8: UpdatedPackages
public UpdatedPackages(
IPackageManagementProject project,
IPackageRepository aggregateRepository)
: this(project.GetPackages(),
aggregateRepository)
{
}
示例9: IsSatellitePackage
public static bool IsSatellitePackage(
IPackage package,
IPackageRepository repository,
FrameworkName targetFramework,
out IPackage runtimePackage)
{
// A satellite package has the following properties:
// 1) A package suffix that matches the package's language, with a dot preceding it
// 2) A dependency on the package with the same Id minus the language suffix
// 3) The dependency can be found by Id in the repository (as its path is needed for installation)
// Example: foo.ja-jp, with a dependency on foo
runtimePackage = null;
if (package.IsSatellitePackage())
{
string runtimePackageId = package.Id.Substring(0, package.Id.Length - (package.Language.Length + 1));
PackageDependency dependency = package.FindDependency(runtimePackageId, targetFramework);
if (dependency != null)
{
runtimePackage = repository.FindPackage(runtimePackageId, versionSpec: dependency.VersionSpec, allowPrereleaseVersions: true, allowUnlisted: true);
}
}
return runtimePackage != null;
}
示例10: MirrorCommand
public MirrorCommand(IPackageSourceProvider packageSourceProvider, ISettings settings, IPackageRepositoryFactory packageRepositoryFactory)
{
SourceProvider = packageSourceProvider;
Settings = settings;
RepositoryFactory = packageRepositoryFactory;
_cacheRepository = MachineCache.Default;
}
示例11: NuGetBrowser
public NuGetBrowser(IEnumerable<string> repositories)
{
var reposToUse = new List<IPackageRepository>();
reposToUse.AddRange(repositories.ToList().Select(r => PackageRepositoryFactory.Default.CreateRepository(r)));
repository = new AggregateRepository(reposToUse);
}
示例12: GetUpdatedPackages
IEnumerable<IPackage> GetUpdatedPackages(
IPackageRepository sourceRepository,
IEnumerable<IPackage> localPackages,
bool includePrelease)
{
return sourceRepository.GetUpdates(localPackages, includePrelease, false);
}
示例13: InstallWalker
public InstallWalker(IPackageRepository localRepository,
IDependencyResolver2 dependencyResolver,
IPackageConstraintProvider constraintProvider,
FrameworkName targetFramework,
ILogger logger,
bool ignoreDependencies,
bool allowPrereleaseVersions,
DependencyVersion dependencyVersion)
: base(targetFramework)
{
if (dependencyResolver == null)
{
throw new ArgumentNullException("dependencyResolver");
}
if (localRepository == null)
{
throw new ArgumentNullException("localRepository");
}
if (logger == null)
{
throw new ArgumentNullException("logger");
}
Repository = localRepository;
Logger = logger;
DependencyResolver = dependencyResolver;
_ignoreDependencies = ignoreDependencies;
ConstraintProvider = constraintProvider;
_operations = new OperationLookup();
_allowPrereleaseVersions = allowPrereleaseVersions;
DependencyVersion = dependencyVersion;
CheckDowngrade = true;
}
示例14: PackagesProviderBase
protected PackagesProviderBase(
IPackageRepository localRepository,
ResourceDictionary resources,
ProviderServices providerServices,
IProgressProvider progressProvider,
ISolutionManager solutionManager)
{
if (resources == null)
{
throw new ArgumentNullException("resources");
}
if (providerServices == null)
{
throw new ArgumentNullException("providerServices");
}
if (solutionManager == null)
{
throw new ArgumentNullException("solutionManager");
}
_localRepository = localRepository;
_providerServices = providerServices;
_progressProvider = progressProvider;
_solutionManager = solutionManager;
_resources = resources;
_outputConsole = new Lazy<IConsole>(() => providerServices.OutputConsoleProvider.CreateOutputConsole(requirePowerShellHost: false));
}
示例15: GetConstraintProvider
public IPackageConstraintProvider GetConstraintProvider(IPackageRepository repository)
{
if (HasSingleProjectSelected()) {
return GetSingleProjectSelected(repository).ConstraintProvider;
}
return NullConstraintProvider.Instance;
}