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


C# Dependency.DetermineStability方法代码示例

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

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

示例1: find

        protected override IRemoteNuget find(Dependency query)
        {
            SemanticVersion version;
            if (!SemanticVersion.TryParse(query.Version, out version))
            {
                RippleLog.Debug("Could not find exact for " + query);
                return null;
            }

            var versionSpec = new VersionSpec(version);
            var package = _repository.FindPackages(query.Name, versionSpec, query.DetermineStability(_stability) == NugetStability.Anything, true).SingleOrDefault();

            if (package == null)
            {
                return null;
            }

            return new RemoteNuget(package);
        }
开发者ID:ventaur,项目名称:ripple,代码行数:19,代码来源:NugetFeed.cs


示例2: find

        protected override IRemoteNuget find(Dependency query)
        {
            throwIfNeeded(query);

            if (query.IsFloat() || query.Version.IsEmpty())
            {
                return Nugets
                    .OrderByDescending(x => x.Version)
                    .FirstOrDefault(x => query.MatchesName(x.Name));
            }

            var version = SemanticVersion.Parse(query.Version);
            var matching = Nugets.Where(x => query.MatchesName(x.Name));

            if (query.DetermineStability(_feed.Stability) == NugetStability.ReleasedOnly)
            {
                return matching.FirstOrDefault(x => x.Version.SpecialVersion.IsEmpty() && x.Version.Equals(version));
            }

            return matching.FirstOrDefault(x => x.Version.Version.Equals(version.Version));
        }
开发者ID:kjnilsson,项目名称:ripple,代码行数:21,代码来源:StubFeed.cs


示例3: findLatest

        protected override IRemoteNuget findLatest(Dependency query)
        {
            RippleLog.Debug("Searching for {0} from {1}".ToFormat(query, _url));
            var candidates = _repository.Search(query.Name, query.DetermineStability(_stability) == NugetStability.Anything)
                                        .Where(x => query.Name == x.Id).OrderBy(x => x.Id).ToList();

            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
                candidate = candidates
                    .OrderByDescending(x => x.Version)
                    .FirstOrDefault();

                if (candidate == null) return null;
            }

            return new RemoteNuget(candidate);
        }
开发者ID:johnsimons,项目名称:ripple,代码行数:21,代码来源:NugetFeed.cs


示例4: findLatest

        protected override IRemoteNuget findLatest(Dependency query)
        {
            RippleLog.Debug("Searching for {0} from {1}".ToFormat(query, _url));
            var candidates = repository.Search(query.Name, query.DetermineStability(Stability) == NugetStability.Anything)
                                        .Where(x => query.Name == x.Id).OrderBy(x => x.Id).ToList();

            return candidates.LatestNuget(query.VersionSpec);
        }
开发者ID:modulexcite,项目名称:ripple,代码行数:8,代码来源:NugetFeed.cs


示例5: findLatest

        protected override IRemoteNuget findLatest(Dependency query)
        {
            RippleLog.Debug("Searching for latest of {0} in {1}".ToFormat(query, _directory));

            var nugets = files
                .Where(x => query.MatchesName(x.Name) && (!x.IsPreRelease || (x.IsPreRelease && query.DetermineStability(_stability) == NugetStability.Anything)))
                .ToList();

            var nuget = nugets
                .OrderByDescending(x => x.Version)
                .FirstOrDefault();

            if (nuget == null)
            {
                return null;
            }

            return new FileSystemNuget(nuget);
        }
开发者ID:modulexcite,项目名称:ripple,代码行数:19,代码来源:FileSystemNugetFeed.cs



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