Exemplo n.º 1
0
        public static AgilityContentServer.AgilityExperimentListing GetExperimentsDelta(DateTime latestModDate)
        {
            try
            {
                Dictionary <string, string> args = new Dictionary <string, string>();
                args.Add("latestModDateStr", latestModDate.ToString("s"));

                List <string> values = new List <string>();
                foreach (string key in args.Keys)
                {
                    values.Add(args[key]);
                }

                string hash = CreateHash("GetExperimentsDelta", values);
                args.Add("hash", hash);

                string result = null;
                using (WebClient wc = new WebClient())
                {
                    wc.Encoding = Encoding.UTF8;
                    result      = wc.DownloadString(BuildAPIUrl("GetExperimentsDelta", args));
                }

                //parse the string...
                APIResult <AgilityContentServer.AgilityExperimentListing> res = Deserialize <APIResult <AgilityContentServer.AgilityExperimentListing> >(result);

                CheckResponse(res);

                return(res.ResponseData);
            }
            catch (Exception ex)
            {
                Agility.Web.Tracing.WebTrace.WriteInfoLine(string.Format("Error getting Experiments for date: {0} - {1}", latestModDate, ex));
            }

            return(null);
        }
Exemplo n.º 2
0
        public static IEnumerable <LatestIndexItem> GetLatestContentDefinitionIndex(DateTime latestModDate)
        {
            try
            {
                Dictionary <string, string> args = new Dictionary <string, string>();
                args.Add("latestModDateStr", latestModDate.ToString("s"));

                List <string> values = new List <string>();
                foreach (string key in args.Keys)
                {
                    values.Add(args[key]);
                }

                string hash = CreateHash("GetContentDefinitionIndex", values);
                args.Add("hash", hash);

                string result = null;
                using (WebClient wc = new WebClient())
                {
                    wc.Encoding = Encoding.UTF8;
                    result      = wc.DownloadString(BuildAPIUrl("GetContentDefinitionIndex", args));
                }



                //parse the string...
                APIResult <IEnumerable <LatestIndexItem> > res = Deserialize <APIResult <IEnumerable <LatestIndexItem> > >(result);

                CheckResponse(res);

                return(res.ResponseData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }