Ejemplo n.º 1
0
        public void LoadData(System.Xml.Linq.XElement location, string name)
        {
            var data = new WeatherData();

            var dir = GetDir("Data");

            var path =  dir + "\\" + name + ".xml";
            data.SaveForecastToFile(location, path, dir);
        }
Ejemplo n.º 2
0
        public void LoadData(System.Xml.Linq.XElement location, string name)
        {
            var data = new WeatherData();

            var codeBase = Assembly.GetExecutingAssembly().CodeBase;
            var uri = new UriBuilder(codeBase);
            var dir =  Path.GetDirectoryName(Uri.UnescapeDataString(uri.Path)) + "\\Data";
            var path = dir + "\\" + name + ".xml";
            data.SaveForecastToFile(location, path, dir);
        }
Ejemplo n.º 3
0
        private void LoadFreshData()
        {
            LoadDataButton.Enabled = false;

            var data = new WeatherData();
            var lokasjonerXml = FetchLocations();
            var locations = data.GetAllLocations(lokasjonerXml);
            var dir = Server.MapPath(@"~/bin/Data/");

            foreach (var lokasjon in locations)
            {
                var grunndata = MetClient.GetForecast(lokasjon.Latitude, lokasjon.Longitude);
                data.SaveForecastToFile(grunndata, Server.MapPath(@"~/bin/Data/" + lokasjon.Name + ".xml"), dir);
            }

            LoadDataButton.Enabled = true;
        }