Exemple #1
0
        private void ReadLocations()
        {
            PluginConfig cfg = (PluginConfig)Helper.DeserializeObject(WeatherPlugin.FORECASTS_XML, typeof(PluginConfig));

            if (cfg.Regions != null)
            {
                cfg.Upgrade();
                forecastRegions.Items.AddRange(cfg.Regions);
            }
        }
Exemple #2
0
 /// <summary>
 /// Initializes the plugin by loading the configuration files
 /// </summary>
 private bool ReadConfiguration()
 {
     Trace.WriteLine("Reading configuration files", "plugin");
     try
     {
         PluginConfig cfg = (PluginConfig)Helper.DeserializeObject(WeatherPlugin.FORECASTS_XML, typeof(PluginConfig));
         Trace.WriteLineIf(cfg.Upgrade(), "Configuration file upgraded", "plugin");
         wxRegions   = cfg.Regions;
         wxVariables = Helper.DeserializeTable(WeatherPlugin.VARIABLES_XML);
         return(true);
     }
     catch (SystemException ex)
     {
         Trace.WriteLine("Error: " + ex.GetBaseException().Message, "error");
         return(false);
     }
 }