public ForecastIORequest(string apiKey, float latF, float longF, Unit unit, Extend[] extend = null, Exclude[] exclude = null)
 {
     _apiKey    = apiKey;
     _latitude  = latF.ToString(CultureInfo.InvariantCulture);
     _longitude = longF.ToString(CultureInfo.InvariantCulture);
     _unit      = Enum.GetName(typeof(Unit), unit);
     _extend    = (extend != null) ? RequestHelpers.FormatExtendString(extend) : "";
     _exclude   = (exclude != null) ? RequestHelpers.FormatExcludeString(exclude) : "";
 }
Exemple #2
0
 public ForecastIORequest(string _apiKey, string _lat, string _long, string _displayname, Unit _unit, params Exclude[] _exclude)
 {
     apiKey      = _apiKey;
     latitude    = _lat.ToString(CultureInfo.InvariantCulture);
     longitude   = _long.ToString(CultureInfo.InvariantCulture);
     displayName = _displayname;
     unit        = Enum.GetName(typeof(Unit), _unit);
     exclude     = RequestHelpers.FormatExcludeString(_exclude);
 }
 public ForecastIORequest(string apiKey, float latF, float longF, DateTime time, Unit unit, Language?lang = null, Extend[] extend = null, Exclude[] exclude = null)
 {
     _apiKey    = apiKey;
     _latitude  = latF.ToString(CultureInfo.InvariantCulture);
     _longitude = longF.ToString(CultureInfo.InvariantCulture);
     _time      = time.ToUTCString();
     _unit      = Enum.GetName(typeof(Unit), unit);
     _extend    = (extend != null) ? RequestHelpers.FormatExtendString(extend) : "";
     _exclude   = (exclude != null) ? RequestHelpers.FormatExcludeString(exclude) : "";
     _lang      = (lang != null) ? RequestHelpers.FormatLanguageEnum(lang) : Language.en.ToString();
 }