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