コード例 #1
0
        private object BuildModel(NameValueCollection queryString)
        {
            var stamp = queryString["stamp"];

            var model = new VersionCheckDetails();
            var items = new List<VersionCheckDetailsItem>();

            if (queryString.AllKeys.Length > 0)
            {
                foreach (var token in queryString.AllKeys)
                {
                    if (!_reservedKeys.ContainsKey(token))
                    {
                        var item = new VersionCheckDetailsItem { Name = token };
                        ParseVersion(item, queryString[token]);
                        items.Add(item);
                    }
                }
            }

            model.Packages = items;
            model.Stamp = stamp;

            return model;
        }
コード例 #2
0
 private void ParseVersion(VersionCheckDetailsItem item, string version)
 {
     item.Version = version;
     item.VersionRange = version;
     if (!string.IsNullOrEmpty(version) && version.Contains(".."))
     {
         var split = version.Split(new[] { ".." }, StringSplitOptions.None);
         if (split.Length >= 1)
             item.Version = split[0];
         if (split.Length >= 2)
             item.VersionRange = split[1];
     }
 } 
コード例 #3
0
 public LatestReleaseDetails GetLatestReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false)
 {
     return GetLatestReleaseInfo(request.Name, request.Version, includeReleasesData);
 }
コード例 #4
0
 public ExistingReleaseDetails GetReleaseInfo(VersionCheckDetailsItem request)
 {
     return GetReleaseInfo(request.Name, request.Version);
 }
コード例 #5
0
 public ReleaseQueryDetails GetReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false)
 {
     return GetReleaseInfo(request.Name, request.Version, request.VersionRange, includeReleasesData);
 }
コード例 #6
0
 public ReleaseQueryDetails GetReleaseInfo(VersionCheckDetailsItem request, bool includeReleasesData = false)
 {
     return(GetReleaseInfo(request.Name, request.Version, request.VersionRange, includeReleasesData));
 }