當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。