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


C# NuGet.PackageDependency类代码示例

本文整理汇总了C#中NuGet.PackageDependency的典型用法代码示例。如果您正苦于以下问题:C# PackageDependency类的具体用法?C# PackageDependency怎么用?C# PackageDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PackageDependency类属于NuGet命名空间,在下文中一共展示了PackageDependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DetectUpgradeAction

        private static PackageUpgradeAction DetectUpgradeAction(PackageDependency dependency, IPackage recentPackage)
        {
            var upgradeType = PackageUpgradeAction.None;
            if (recentPackage == null)
            {
                upgradeType = PackageUpgradeAction.Unknown;
            }
            else if (dependency.VersionSpec.Satisfies(recentPackage.Version))
            {
                upgradeType = IsMinVersionUpgradeable(dependency, recentPackage)
                        ? PackageUpgradeAction.MinVersion
                        : PackageUpgradeAction.None;
            }
            else
            {
                var fromRelease = DependsOnReleaseVersion(dependency);

                if (recentPackage.IsReleaseVersion())
                {
                    upgradeType = fromRelease ? PackageUpgradeAction.ReleaseToRelease : PackageUpgradeAction.PrereleaseToRelease;
                }
                else
                {
                    upgradeType = fromRelease ? PackageUpgradeAction.ReleaseToPrerelease : PackageUpgradeAction.PrereleaseToPrerelease;
                }
            }

            return upgradeType;
        }
开发者ID:patricksadowski,项目名称:NuGet.Dgml,代码行数:29,代码来源:UpgradeWalker.cs

示例2: GetLinkTo_dependency_should_return_link_with_dependency_name_as_target

		public void GetLinkTo_dependency_should_return_link_with_dependency_name_as_target()
		{
			var p = new TestPackage { Id = "test-package", Version = new Version("1.2.3") };
			var dependency = new PackageDependency("dep", new VersionSpec { MinVersion = new Version("1.2.3") });

			Assert.AreEqual("dep (1.2.3)", p.GetLinkTo(dependency).Target);
		}
开发者ID:typesafe,项目名称:nuget.dgml,代码行数:7,代码来源:PackageExtensionsTests.cs

示例3: GetLinkTo_dependency_should_return_link_with_packge_category

		public void GetLinkTo_dependency_should_return_link_with_packge_category()
		{
			var p = new TestPackage { Id = "test-package", Version = new Version("1.2.3") };
			var dependency = new PackageDependency("dep", new VersionSpec { MinVersion = new Version("1.2.3") });

			Assert.AreEqual("Package", p.GetLinkTo(dependency).Category1);
		}
开发者ID:typesafe,项目名称:nuget.dgml,代码行数:7,代码来源:PackageExtensionsTests.cs

示例4: IsPrereleaseDependency

        private static bool IsPrereleaseDependency(PackageDependency pd)
        {
            if (pd.VersionSpec == null)
            {
                return false;
            }

            return IsPreReleasedVersion(pd.VersionSpec.MinVersion) || IsPreReleasedVersion(pd.VersionSpec.MaxVersion);
        }
开发者ID:campersau,项目名称:NuGetPackageExplorer,代码行数:9,代码来源:PrereleasePackageDependencyRule.cs

示例5: CreatePackageIssue

 private static PackageIssue CreatePackageIssue(PackageDependency target)
 {
     return new PackageIssue(
         PackageIssueLevel.Error,
         "Invalid prerelease dependency",
         String.Format(CultureInfo.CurrentCulture,
                       "A stable release of a package must not have a dependency on a prerelease package, '{0}'.",
                       target),
         String.Format(CultureInfo.CurrentCulture,
                       "Either modify the version spec of dependency '{0}' or update the version field.", target)
         );
 }
开发者ID:campersau,项目名称:NuGetPackageExplorer,代码行数:12,代码来源:PrereleasePackageDependencyRule.cs

示例6: ShowDownloadStatus

 public void ShowDownloadStatus(PackageDependency dependentPackage)
 {
     if (uxDownloadStatus.InvokeRequired)
     {
         uxDownloadStatus.Invoke((Action)(() =>
         {
             uxDownloadStatus.Text = "Downloading the dependencies\n" + "Downloading " + dependentPackage.Id;
         }));
     }
     else
     {
         uxDownloadStatus.Text = "Downloading the dependencies\n" + "Downloading " + dependentPackage.Id;
     }
 }
开发者ID:hanchao,项目名称:DotSpatial,代码行数:14,代码来源:DownloadForm.cs

示例7: Map

 public Dependency Map(PackageDependency packageDependency, string packageId, string packageVersion)
 {
     if (packageDependency == null)
     {
         throw new ArgumentNullException("packageDependency");
     }
     string versionSpec = packageDependency.VersionSpec != null ? packageDependency.VersionSpec.ToString() : string.Empty;
     return new Dependency
     {
         Name = packageDependency.Id,
         PackageId = !string.IsNullOrWhiteSpace(packageId) ? packageId : string.Empty,
         PackageVersion = !string.IsNullOrWhiteSpace(packageVersion) ? packageVersion : string.Empty,
         VersionSpec = versionSpec
     };
 }
开发者ID:dioptre,项目名称:nkd,代码行数:15,代码来源:DependencyMapper.cs

示例8: ResolveDependency

        public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
        {
            IDependencyResolver dependencyResolver = _repo as IDependencyResolver;
            if (dependencyResolver != null)
            {
                return dependencyResolver.ResolveDependency(dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion);
            }

            return DependencyResolveUtility.ResolveDependencyCore(
                _repo,
                dependency,
                constraintProvider,
                allowPrereleaseVersions,
                preferListedPackages,
                dependencyVersion);
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:16,代码来源:IDependencyResolver.cs

示例9: AddInDependency

        public AddInDependency(PackageDependency packageDependency)
        {
            if (packageDependency != null)
            {
                IVersionSpec versionSpec = packageDependency.VersionSpec;

                Id = packageDependency.Id;
                if (versionSpec.MinVersion != null)
                {
                    MinimumVersion = versionSpec.MinVersion.Version;
                }
                if (versionSpec.MaxVersion != null)
                {
                    MaximumVersion = versionSpec.MaxVersion.Version;
                }
                IncludeMinimumVersion = packageDependency.VersionSpec.IsMinInclusive;
                IncludeMaximumVersion = packageDependency.VersionSpec.IsMaxInclusive;
            }
        }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:19,代码来源:AddInDependency.cs

示例10: Context

        public override void Context()
        {
            var minVersionSpec = new VersionSpec
            {
                MinVersion = new SemanticVersion("1.0.0"),
                IsMinInclusive = true
            };
            packageDependencyWithMinVersion = new PackageDependency("fiddler", minVersionSpec);

            var minAndMaxVersionSpec = new VersionSpec
            {
                MinVersion = new SemanticVersion("1.0.0"),
                MaxVersion = new SemanticVersion("2.0.0"),
                IsMinInclusive = true
            };
            packageDependencyWithMaxVersion = new PackageDependency("dude", minAndMaxVersionSpec);

            guideline = new DependencyWithNoVersionGuideline();
        }
开发者ID:pkdevboxy,项目名称:package-validator,代码行数:19,代码来源:DependencyWithNoVersionGuidelineSpecs.cs

示例11: OnDependencyResolveError

 protected virtual void OnDependencyResolveError(PackageDependency dependency)
 {
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:3,代码来源:PackageWalker.cs

示例12: DependsOnReleaseVersion

 private static bool DependsOnReleaseVersion(PackageDependency dependency)
 {
     return (dependency.VersionSpec.MaxVersion != null) &&
         string.IsNullOrEmpty(dependency.VersionSpec.MaxVersion.SpecialVersion) &&
         dependency.VersionSpec.IsMaxInclusive;
 }
开发者ID:patricksadowski,项目名称:NuGet.Dgml,代码行数:6,代码来源:UpgradeWalker.cs

示例13: IsMinVersionUpgradeable

 private static bool IsMinVersionUpgradeable(PackageDependency dependency, IPackage recentPackage)
 {
     return (dependency.VersionSpec.MinVersion != null) && (dependency.VersionSpec.MinVersion < recentPackage.Version);
 }
开发者ID:patricksadowski,项目名称:NuGet.Dgml,代码行数:4,代码来源:UpgradeWalker.cs

示例14: ResolveDependency

 protected override IPackage ResolveDependency(PackageDependency dependency)
 {
     return Repository.FindDependency(dependency);
 }
开发者ID:grendello,项目名称:nuget,代码行数:4,代码来源:DependentsWalker.cs

示例15: ResolveDependency

 public IPackage ResolveDependency(PackageDependency dependency, IPackageConstraintProvider constraintProvider, bool allowPrereleaseVersions, bool preferListedPackages, DependencyVersion dependencyVersion)
 {
     // Use the primary repository to look up dependencies. Fallback to the aggregate repository only if we can't find a package here.
     return _primaryRepository.ResolveDependency (dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion) ??
     _dependencyResolver.ResolveDependency (dependency, constraintProvider, allowPrereleaseVersions, preferListedPackages, dependencyVersion);
 }
开发者ID:twing207,项目名称:monodevelop-dnx-addin,代码行数:6,代码来源:FallbackRepository.cs


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