public async Task <regionchart> GetRegionChartAsync(string city, string state, string neighborhood, string zip, string unittype, string width, string height, SimpleChartDuration chartDuration, ChartVariant chartVariant)
        {
            try
            {
                Hashtable p = new Hashtable
                {
                    { "zws-id", Zwsid },
                    { "city", city },
                    { "state", state },
                    { "neighborhood", neighborhood },
                    { "zip", zip },
                    { "unit-type", unittype },
                    { "width", width },
                    { "height", height },
                    { "chartDuration", ZillowExtensions.GetXmlName(chartDuration) },
                    { "chartVariant", chartVariant }
                };

                return(await CallAPIAsync <regionchart>(ZillowURI.RegionChart, p));
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public regionchart GetRegionChart(string city, string state, string neighborhood, string zip, string unittype, string width, string height, SimpleChartDuration chartDuration, ChartVariant chartVariant)
        {
            try
            {
                Hashtable p = new Hashtable
                {
                    { "zws-id", Zwsid },
                    { "city", city },
                    { "state", state },
                    { "neighborhood", neighborhood },
                    { "zip", zip },
                    { "unit-type", unittype },
                    { "width", width },
                    { "height", height },
                    { "chartDuration", ZillowExtensions.GetXmlName(chartDuration) },
                    { "chartVariant", chartVariant }
                };

                regionchart c = (regionchart)CallAPI(ZillowURI.RegionChart, p, typeof(regionchart));

                if (c == null)
                {
                    throw new NullReferenceException("regionchart API value is null");
                }

                if (int.Parse(c.message.code) != 0)
                {
                    throw new Exception(string.Format("Zillow Error #{0}: {1}", c.message.code, c.message.text));
                }

                return(c);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw ex;
            }
        }