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
        public virtual ActionResult Index(VersionCheckDetails details)
        {
            var service = PackageSettings.Settings.ExistingReleaseService;
            var result = service.GetReleaseInfo(details);

            return View(result);
        }
예제 #3
0
        public virtual ActionResult Update(VersionCheckDetails details, bool? withDetails)
        {
            var service = PackageSettings.Settings.NewReleaseService;
            var result = service.GetLatestReleaseInfo(details, withDetails ?? false);

            // Indicates how much data we want to show
            ViewBag.WithDetails = withDetails;

            return View(result);
        }
예제 #4
0
        public virtual ActionResult Update(VersionCheckDetails details, bool? withDetails)
        {
            var service = PackageSettings.Settings.ReleaseQueryService;
            var result = service.GetReleaseInfo(details, true);

            // Indicates how much data we want to show
            ViewBag.WithDetails = withDetails;

            return View(MVC.Version.Install.Views.Update, MVC.Shared.Views._Simple, result);
        }
예제 #5
0
        public virtual ActionResult Index(VersionCheckDetails details)
        { 
            if (!HttpContext.Request.Url.Query.Contains(".."))
            {
                var service = PackageSettings.Settings.ReleaseQueryService;
                var result = service.GetReleaseInfo(details, false);

                return View(MVC.Version.Install.Views.Index, MVC.Shared.Views._Simple, result);
            }

            return Update(details, null);
        }
        public ExistingReleaseInfo GetReleaseInfo(VersionCheckDetails request)
        {
            var info = new ExistingReleaseInfo { Details = new Dictionary<string, ExistingReleaseDetails>() };

            foreach (var package in request.Packages)
            {
                var detail = GetReleaseInfo(package);

                info.Details.Add(package.Name, detail);
            } 

            return info;
        }
예제 #7
0
        public LatestReleaseInfo GetLatestReleaseInfo(VersionCheckDetails request, bool includeReleasesData = false)
        {
            var info = new LatestReleaseInfo { Details = new Dictionary<string, LatestReleaseDetails>() };

            foreach (var package in request.Packages)
            {
                var detail = GetLatestReleaseInfo(package, includeReleasesData);

                info.Details.Add(package.Name, detail);
                if (detail.HasNewer)
                    info.HasNewer = true;
            } 

            return info;
        }
예제 #8
0
        public ReleaseQueryInfo GetReleaseInfo(VersionCheckDetails request, bool includeReleasesData = false)
        {
            var info = new ReleaseQueryInfo {
                Details = new Dictionary <string, ReleaseQueryDetails>()
            };

            foreach (var package in request.Packages)
            {
                var detail = GetReleaseInfo(package, includeReleasesData);

                info.Details.Add(package.Name, detail);
                if (detail.HasNewer)
                {
                    info.HasNewer = true;
                }
            }

            return(info);
        }