public static GetDomainsByExpireDateResult Parse(string responseText)
        {
            var response = new GetDomainsByExpireDateResult();

            var doc         = XDocument.Parse(responseText);
            var resultArray = doc.XPathSelectElement(@"//item[@key=""exp_domains""]/dt_array");

            foreach (var item in ResponseHelper.ReadArray(resultArray))
            {
                var entry = new DomainsByExpireDateResultItem
                {
                    Name       = item["name"],
                    LetExpire  = (item["f_let_expire"] == "Y" ? true : false),
                    AutoRenew  = (item["f_auto_renew"] == "Y" ? true : false),
                    ExpireDate = DateTime.ParseExact(item["expiredate"], "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
                };

                response.DomainList.Add(entry);
            }

            var attributes = ResponseHelper.ParseAttributes(responseText);

            response.Page      = int.Parse(attributes["page"]);
            response.Remainder = (attributes["remainder"] == "1" ? true : false);
            response.Total     = int.Parse(attributes["total"]);

            return(response);
        }
Exemplo n.º 2
0
 public async Task <GetDomainsByExpireDateResult> GetDomainsByExpireDateAsync(GetDomainsByExpireDateRequest request) =>
 GetDomainsByExpireDateResult.Parse(await SendAsync(request).ConfigureAwait(false));