コード例 #1
0
        public Clouds(XmlNode node)
        {
            string valueQuery = "clouds/@value";
            string allQuery   = "clouds/@all";

            Value = node.SelectSingleNode(valueQuery)?.InnerText;
            All   = FixDouble.ToDouble(node.SelectSingleNode(allQuery)?.InnerText);
        }
コード例 #2
0
        public Pressure(XmlNode node)
        {
            string unitQuery  = "pressure/@unit";
            string valueQuery = "pressure/@value";

            Unit  = node.SelectSingleNode(unitQuery)?.InnerText;
            Value = FixDouble.ToDouble(node.SelectSingleNode(valueQuery)?.InnerText);
        }
コード例 #3
0
        public Precipitation(XmlNode node)
        {
            string unitQuery  = "precipitation/@unit";
            string valueQuery = "precipitation/@value";
            string typeQuery  = "precipitation/@type";

            Unit  = node.SelectSingleNode(unitQuery)?.InnerText;
            Value = FixDouble.ToDouble(node.SelectSingleNode(valueQuery)?.InnerText);
            Type  = node.SelectSingleNode(typeQuery)?.InnerText;
        }
コード例 #4
0
        public Symbol(XmlNode node)
        {
            string numberQuery = "symbol/@number";
            string nameQuery   = "symbol/@name";
            string varQuery    = "symbol/@var";

            Name   = node.SelectSingleNode(nameQuery)?.InnerText;
            Number = FixDouble.ToDouble(node.SelectSingleNode(numberQuery)?.InnerText);
            Var    = node.SelectSingleNode(varQuery)?.InnerText;
        }
コード例 #5
0
        public Temperature(XmlNode node)
        {
            string unitQuery  = "temperature/@unit";
            string valueQuery = "temperature/@value";
            string minQuery   = "temperature/@min";
            string maxQuery   = "temperature/@max";

            UnitType = node.SelectSingleNode(unitQuery)?.InnerText;
            Value    = FixDouble.ToDouble(node.SelectSingleNode(valueQuery)?.InnerText);
            Min      = FixDouble.ToDouble(node.SelectSingleNode(minQuery)?.InnerText);
            Max      = FixDouble.ToDouble(node.SelectSingleNode(maxQuery)?.InnerText);
        }
コード例 #6
0
        public Forecast(params object[] args)
        {
            Id       = int.Parse(args[0].ToString());
            From     = DateTime.Parse(args[2].ToString());
            To       = DateTime.Parse(args[3].ToString());
            Humidity = FixDouble.ToDouble(args[4].ToString());

            Temperature = new Temperature
            {
                UnitType = args[6].ToString(),
                Value    = FixDouble.ToDouble(args[7].ToString()),
                Min      = FixDouble.ToDouble(args[8].ToString()),
                Max      = FixDouble.ToDouble(args[9].ToString()),
            };

            Precipitation = new Precipitation
            {
                Unit  = args[11].ToString(),
                Value = FixDouble.ToDouble(args[12].ToString()),
                Type  = args[13].ToString()
            };

            Pressure = new Pressure
            {
                Unit  = args[15].ToString(),
                Value = FixDouble.ToDouble(args[16].ToString())
            };

            Symbol = new Symbol
            {
                Number = FixDouble.ToDouble(args[18].ToString()),
                Name   = args[19].ToString(),
                Var    = args[20].ToString(),
            };

            Wind = new Wind
            {
                Direction     = FixDouble.ToDouble(args[22].ToString()),
                Code          = args[23].ToString(),
                DirectionName = args[24].ToString(),
                Speed         = FixDouble.ToDouble(args[26].ToString()),
                SpeedName     = args[27].ToString(),
            };

            Clouds = new Clouds
            {
                Value = args[29].ToString(),
                All   = FixDouble.ToDouble(args[30].ToString()),
            };
        }
コード例 #7
0
        public Forecast(XmlNode node)
        {
            string fromQuery     = "@from";
            string toQuery       = "@to";
            string humidityQuery = "humidity/@value";

            From          = DateTime.Parse($"{node.SelectSingleNode(fromQuery)?.InnerText:O}");
            To            = DateTime.Parse($"{node.SelectSingleNode(toQuery)?.InnerText:O}");
            Wind          = new Wind(node);
            Temperature   = new Temperature(node);
            Pressure      = new Pressure(node);
            Symbol        = new Symbol(node);
            Humidity      = FixDouble.ToDouble(node.SelectSingleNode(humidityQuery)?.InnerText);
            Clouds        = new Clouds(node);
            Precipitation = new Precipitation(node);
        }
コード例 #8
0
        public Wind(XmlNode node)
        {
            string speedQuery   = "windSpeed/@mps";
            string nameQuery    = "windSpeed/@name";
            string dirQuery     = "windDirection/@deg";
            string dirNameQuery = "windDirection/@name";
            string codeQuery    = "windDirection/@code";

            Speed     = FixDouble.ToDouble(node.SelectSingleNode(speedQuery)?.InnerText);
            SpeedName = node.SelectSingleNode(nameQuery)?.InnerText;

            Direction     = FixDouble.ToDouble(node.SelectSingleNode(dirQuery)?.InnerText);
            DirectionName = node.SelectSingleNode(dirNameQuery)?.InnerText;

            Code = node.SelectSingleNode(codeQuery)?.InnerText;
        }
コード例 #9
0
 public Location(params string[] args)
 {
     Id              = int.Parse(args[0]);
     Name            = args[1];
     Latitude        = FixDouble.ToDouble(args[4]);
     Longtitude      = FixDouble.ToDouble(args[5]);
     FeatureClass    = args[6];
     FeatureCode     = args[7];
     CountryCode     = args[8];
     AlternativeCode = args[9];
     AdminCode1      = args[10];
     AdminCode2      = args[11];
     AdminCode3      = args[12];
     AdminCode4      = args[13];
     Population      = (long)FixDouble.ToDouble(args[14]);
     Elevation       = (int)FixDouble.ToDouble(args[15]);
     TimeZone        = args[16];
 }
コード例 #10
0
        public Location(params object[] args)
        {
            Id         = int.Parse(args[0].ToString());
            ForecastId = int.Parse(args[1].ToString());

            Name            = args[2].ToString();
            AlternativeName = args[3].ToString();

            Latitude   = FixDouble.ToDouble(args[4].ToString());
            Longtitude = FixDouble.ToDouble(args[5].ToString());

            FeatureClass = args[6].ToString();
            FeatureCode  = args[7].ToString();
            CountryCode  = args[8].ToString();

            AdminCode1 = args[9].ToString();
            AdminCode2 = args[10].ToString();
            AdminCode3 = args[11].ToString();
            AdminCode4 = args[12].ToString();

            Population = (long)FixDouble.ToDouble(args[13].ToString());
        }
コード例 #11
0
 public string ToQuery(Forecast f)
 {
     return($"({f.Id}, '{Value}', {FixDouble.ToString(All)}),");
 }
コード例 #12
0
 public string ToQuery(City city)
 {
     return($"({city.Id}, '{From}', '{To}', {FixDouble.ToString(Humidity)})");
 }
コード例 #13
0
 public string ToQuery(Forecast f)
 {
     return($"({f.Id}, {FixDouble.ToString(Number)}, '{Name}','{Var}'),");
 }
コード例 #14
0
 public string ToQuery(Forecast f)
 {
     return($"({f.Id}, '{Unit}', {FixDouble.ToString(Value)}, '{Type}'),");
 }
コード例 #15
0
 public string ToDirQuery(Forecast f)
 {
     return($"({f.Id}, {FixDouble.ToString(Direction)}, '{Code}','{DirectionName}'),");
 }
コード例 #16
0
 public string ToQuery(Forecast f)
 {
     return($"({f.Id}, '{UnitType}', {FixDouble.ToString(Value)}, " +
            $"{FixDouble.ToString(Min)}, {FixDouble.ToString(Max)}),");
 }
コード例 #17
0
 public string ToSpeedQuery(Forecast f)
 {
     return($"({f.Id}, {FixDouble.ToString(Speed)}, '{SpeedName}'),");
 }