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


C# IVersionSpec类代码示例

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


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

示例1: Latest

        public static IPackage Latest(this IEnumerable<IPackage> values, IVersionSpec spec)
        {
            var candidates = values.ToArray();
            var candidate = candidates.FirstOrDefault(x => x.IsAbsoluteLatestVersion)
                            ?? candidates.FirstOrDefault(x => x.IsLatestVersion);

            if (candidate == null)
            {
                // If both absolute and latest are false, then we order in descending order (by version) and take the top
                var ordered = candidates
                    .OrderByDescending(x => x.Version)
                    .ToArray();

                if (spec == null)
                {
                    candidate = ordered.FirstOrDefault();
                }
                else
                {
                    Func<IPackage, bool> predicate;
                    if (spec.IsMaxInclusive)
                    {
                        predicate = x => x.Version <= spec.MaxVersion;
                    }
                    else
                    {
                        predicate = x => x.Version < spec.MaxVersion;
                    }

                    candidate = ordered.FirstOrDefault(predicate);
                }
            }

            return candidate;
        }
开发者ID:modulexcite,项目名称:ripple,代码行数:35,代码来源:PackageFiltering.cs

示例2: DependencyInfo

        public DependencyInfo(FullPackageName fullName, IVersionSpec versionSpec)
        {
            FullName = fullName;

            // Default to the simple version (which means min-version)
            VersionSpec = versionSpec ?? VersionUtility.ParseVersionSpec(FullName.Version.ToString());
        }
开发者ID:larsw,项目名称:nuget,代码行数:7,代码来源:Program.cs

示例3: Matches

        public static bool Matches(IVersionSpec versionSpec, SemanticVersion version)
        {
            if (versionSpec == null)
                return true; // I CAN'T DEAL WITH THIS

            bool minVersion;
            if (versionSpec.MinVersion == null) {
                minVersion = true; // no preconditon? LET'S DO IT
            } else if (versionSpec.IsMinInclusive) {
                minVersion = version >= versionSpec.MinVersion;
            } else {
                minVersion = version > versionSpec.MinVersion;
            }

            bool maxVersion;
            if (versionSpec.MaxVersion == null) {
                maxVersion = true; // no preconditon? LET'S DO IT
            } else if (versionSpec.IsMaxInclusive) {
                maxVersion = version <= versionSpec.MaxVersion;
            } else {
                maxVersion = version < versionSpec.MaxVersion;
            }

            return maxVersion && minVersion;
        }
开发者ID:christianrondeau,项目名称:Squirrel.Windows.Next,代码行数:25,代码来源:ReleasePackage.cs

示例4: GetPackage

        public void GetPackage(string packageId, IVersionSpec version)
        {
            /*
            if (repositoryRemote == null)
            {
                //var repositoryRemote = PackageRepositoryFactory.Default.CreateRepository("https://nuget.org/api/v2");
                repositoryRemote = PackageRepositoryFactory.Default.CreateRepository(@"C:\Dev\Tools\NuGetFeed");
            }
            if (repositoryLocal == null)
            {
                repositoryLocal = GetLocalRepository();
            }
            */
            var packageInfo = FindPackage(packageId, version, false, false);

            if (packageInfo == null)
                throw new NotImplementedException();

            var localRepository = _repositories[0];
            if (localRepository != packageInfo.Item1)
            {
                localRepository.AddPackage(packageInfo.Item2);
            }

            foreach (var deps in packageInfo.Item2.DependencySets)
            {
                foreach (var dep in deps.Dependencies)
                {
                    GetPackage(dep.Id, dep.VersionSpec);
                }
            }
        }
开发者ID:CloudMorph,项目名称:cloudmorph-fabric,代码行数:32,代码来源:LibraryService.cs

示例5: PackageDependency

 public PackageDependency(string id, IVersionSpec versionSpec)
 {
     if (String.IsNullOrEmpty(id)) {
         throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "id");
     }
     Id = id;
     VersionSpec = versionSpec;
 }
开发者ID:larsw,项目名称:nuget,代码行数:8,代码来源:PackageDependency.cs

示例6: PackageDependency

 public PackageDependency(string id, IVersionSpec versionSpec)
 {
     if (String.IsNullOrEmpty(id)) {
         throw new ArgumentNullException("id");
     }
     Id = id;
     VersionSpec = versionSpec;
 }
开发者ID:jacksonh,项目名称:nuget,代码行数:8,代码来源:PackageDependency.cs

示例7: SafeToVerRange

 internal static VersionRange SafeToVerRange(IVersionSpec spec)
 {
     if(spec == null) {
         return null;
     }
     return new VersionRange(
         SafeToNuGetVer(spec.MinVersion),
         spec.IsMinInclusive,
         SafeToNuGetVer(spec.MaxVersion),
         spec.IsMaxInclusive);
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:11,代码来源:CoreConverters.cs

示例8: Dependency

        public Dependency(string name, IVersionSpec versionSpec)
            : this(name)
        {
            if (versionSpec.MinVersion != null && versionSpec.MaxVersion != null &&
                versionSpec.MinVersion == versionSpec.MaxVersion)
            {
                Mode = UpdateMode.Fixed;
                Version = versionSpec.MinVersion.Version.ToString();
            }
            else
            {
                Mode = UpdateMode.Float;
            }

            _versionSpec = versionSpec;
        }
开发者ID:kjnilsson,项目名称:ripple,代码行数:16,代码来源:Dependency.cs

示例9: AzureVersionSpec

        public AzureVersionSpec(IVersionSpec version)
        {

            this.IsMaxInclusive = version.IsMaxInclusive;
            this.IsMinInclusive = version.IsMinInclusive;

            if (version.MaxVersion != null)
            {
                this.MaxVersionSpecial = version.MaxVersion.SpecialVersion;
                this.MaxVersionVersion = version.MaxVersion.Version.ToString();
            }

            if (version.MinVersion != null)
            {
                this.MinVersionSpecial = version.MinVersion.SpecialVersion;
                this.MinVersionVersion = version.MinVersion.Version.ToString();
            }
        }
开发者ID:rjygraham,项目名称:Nuget.Server.AzureStorage,代码行数:18,代码来源:AzureVersionSpec.cs

示例10: EnumPackageRequests

        /// <summary>
        /// Enumerates the required package requests.
        /// </summary>
        /// <param name="packageId">
        /// The package id.
        /// </param>
        /// <param name="version">
        /// The version.
        /// </param>
        /// <returns>
        /// An enumeration of package requests.
        /// </returns>
        public IEnumerable<SolutionPackageRequest> EnumPackageRequests(string packageId, IVersionSpec version)
        {
            if (packageId.EndsWith(Constants.SolutionPackagePostFix, StringComparison.CurrentCultureIgnoreCase))
            {
                var packageRequest = SolutionPackageRequestFactory.CreatePackageRequest(packageId, version);
                if (packageRequest != null)
                {
                    yield return packageRequest;

                    foreach (var dependencySet in packageRequest.Package.DependencySets)
                    {
                        foreach (var dependency in dependencySet.Dependencies)
                        {
                            foreach (var request in this.EnumPackageRequests(dependency.Id, dependency.VersionSpec))
                            {
                                yield return request;
                            }
                        }
                    }
                }
            }
        }
开发者ID:alexfdezsauco,项目名称:PackageManager.SharePoint,代码行数:34,代码来源:SolutionPackageRequestService.cs

示例11: findPackageFromName

        IPackage findPackageFromName(string id, IVersionSpec versionSpec, string packagesRootDir = null, IQueryable<IPackage> machineCache = null)
        {
            machineCache = machineCache ?? Enumerable.Empty<IPackage>().AsQueryable();

            if (packagesRootDir != null && localPackageCache == null) {
                localPackageCache = Utility.GetAllFilePathsRecursively(packagesRootDir)
                    .Where(PackageHelper.IsPackageFile)
                    .Select(x => new ZipPackage(x))
                    .ToArray();
            }

            return findPackageFromNameInList(id, versionSpec, localPackageCache ?? Enumerable.Empty<IPackage>()) ??
                findPackageFromNameInList(id, versionSpec, machineCache);
        }
开发者ID:KyleGobel,项目名称:Shimmer,代码行数:14,代码来源:ReleasePackage.cs

示例12: findPackageFromNameInList

 static IPackage findPackageFromNameInList(string id, IVersionSpec versionSpec, IEnumerable<IPackage> packageList)
 {
     return packageList.Where(x => x.Id == id).ToArray()
         .FirstOrDefault(x => VersionComparer.Matches(versionSpec, x.Version));
 }
开发者ID:KyleGobel,项目名称:Shimmer,代码行数:5,代码来源:ReleasePackage.cs

示例13: NuspecDependency

 public NuspecDependency(string name, IVersionSpec spec)
 {
     Name = name;
     VersionSpec = spec;
 }
开发者ID:4lexm,项目名称:ripple,代码行数:5,代码来源:NuspecDependency.cs

示例14: UpdatePackageReference

		public void UpdatePackageReference (string packageId, IVersionSpec versionSpec, bool updateDependencies, bool allowPrereleaseVersions)
		{
			throw new NotImplementedException ();
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:4,代码来源:FakeProjectManager.cs

示例15: AddConstraint

 public void AddConstraint(string packageId, IVersionSpec versionSpec)
 {
     _constraints[packageId] = versionSpec;
 }
开发者ID:Newtopian,项目名称:nuget,代码行数:4,代码来源:DefaultConstraintProvider.cs


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