public MainWindow()
        {
            InitializeComponent();
            _UpdateTimer           = new Timer(60000);
            _UpdateTimer.Elapsed  += _UpdateTimer_Elapsed;
            _UpdateTimer.AutoReset = true;
            _UpdateTimer.Enabled   = true;

            _NOAAClient         = new NOAAClient();
            _MetNoClient        = new MetNoClient();
            _PollenClient       = new PollenClient();
            _OptionsService     = new OptionsService();
            _ApplicationOptions = _OptionsService.LoadSavedOptions();
            _GeographyService   = new GeographyService();
            _WeatherIconService = new WeatherIconService();

            if (_ApplicationOptions.SelectedZip != null)
            {
                ZipTextBox.Text = _ApplicationOptions.SelectedZip.Zip.ToString();
            }

            ErrorHelper.ErrorLabel = ErrorText;
            ErrorHelper.EmitError("Errors will appear here.");

            GetWeatherForecast();
            UpdatePollenForecast();
        }
Example #2
0
        public HttpResponseMessage SelectStateProvinceByCountryId(int id)
        {
            ItemsResponse <StateProvince> response = new ItemsResponse <StateProvince>();

            response.Items = GeographyService.SelectStateProvinceByCountryId(id);

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Example #3
0
        public HttpResponseMessage SelectAllCountries()
        {
            ItemsResponse <Country> response = new ItemsResponse <Country>();

            response.Items = GeographyService.SelectAllCountries();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Example #4
0
 public JsonResult GetCitiesByName(string namePart)
 {
     var gs = new GeographyService();
     var cities = gs.GetCitiesByName(namePart);
     return new JsonResult
     {
         Data = new GeographyService().GetCitiesByName(namePart)
     };
 }
 static CoordinateTransformer()
 {
     CoordinateTransformationFactory = new CoordinateTransformationFactory();
     GeographyService = new GeographyService();
 }
Example #6
0
 public GeoController(ILogger <GeoController> logger, GeographyService geographyService)
 {
     _logger           = logger;
     _geographyService = geographyService;
 }