}// end of method frmPreferences_Activated private void frmPreferences_Load(object sender, EventArgs e) { frmPreference = this; flpIconSet.Controls.Clear(); // remove any previous icon set used and reload at runtime LoadInstalledIconPacks(); // Weather tab #region Test Data (un-comment lines for testing) //WeatherLionMain.authorizedProviders = new string[] { // WeatherLionMain.DARK_SKY, WeatherLionMain.OPEN_WEATHER, // WeatherLionMain.WEATHER_BIT, WeatherLionMain.YAHOO_WEATHER }; //WeatherLionMain.storedPreferences.StoredPreferences.Provider = WeatherLionMain.DARK_SKY; //WeatherLionMain.storedPreferences.StoredPreferences.Location = "Pine Hills, FL"; //WeatherLionMain.storedPreferences.StoredPreferences.Interval = 1800000; //WeatherLionMain.storedPreferences.StoredPreferences.UseMetric = false; //WeatherLionMain.storedPreferences.StoredPreferences.UseSystemLocation = false; //WeatherLionMain.storedPreferences.StoredPreferences.WidgetBackground = "default"; //WeatherLionMain.storedPreferences.StoredPreferences.IconSet = "hero"; //List<string> preferenceUpdated = new List<string>(); #endregion // load the combo box with the default weather providers cboWeatherProviders.Items.Clear(); // refresh the list cboWeatherProviders.Items.AddRange(WeatherLionMain.authorizedProviders); // select current weather provider cboWeatherProviders.SelectedItem = WeatherLionMain.storedPreferences.StoredPreferences.Provider; // select the current weather provider cboLocation.Text = WeatherLionMain.storedPreferences.StoredPreferences.Location; // select the current refresh period string updateInterval = UtilityMethod.MillisecondsToMinutes( WeatherLionMain.storedPreferences.StoredPreferences.Interval).ToString(); lblInterval.Text = $"{updateInterval} min."; cboRefreshInterval.SelectedItem = updateInterval; chkUseMetric.Checked = WeatherLionMain.storedPreferences.StoredPreferences.UseMetric; chkUseSystemLocation.Checked = WeatherLionMain.storedPreferences.StoredPreferences.UseSystemLocation; // load the three background options picDefault.ImageLocation = DEFAULT_BACKGROUND_IMAGE; picAndroid.ImageLocation = ANDROID_BACKGROUND_IMAGE; picRabalac.ImageLocation = RABALAC_BACKGROUND_IMAGE; // Icon Set tab foreach (Control c in tabIconSet.Controls) { if (c is FlowLayoutPanel) { foreach (Control sc in c.Controls) { if (sc is FlowLayoutPanel) { foreach (Control tc in sc.Controls) { if (tc is RadioButton) { RadioButton rb = tc as RadioButton; rb.CheckedChanged += new EventHandler(IconSetChanged); }// end of if block else if (tc is PictureBox) { PictureBox pb = tc as PictureBox; pb.Click += new EventHandler(SelectIconSetRadioButton); } // end of if block } // end of for each loop } // end of if block } // end of inner foreach block } // end of if block } // end of foreach block // Background tab // Make the radio buttons on each page mutually exclusive foreach (Control c in tabBackground.Controls) { if (c is FlowLayoutPanel) { foreach (Control sc in c.Controls) { if (sc is RadioButton) { RadioButton rb = sc as RadioButton; rb.CheckedChanged += new EventHandler(BackgroundChanged); }// end of if block else if (sc is PictureBox) { PictureBox pb = sc as PictureBox; pb.Click += new EventHandler(SelectBackgroundRadioButton); } // end of if block } // end of inner foreach block } // end of if block } // end of foreach block switch (WeatherLionMain.storedPreferences.StoredPreferences.WidgetBackground) { case "default": radDefault.Checked = true; break; case "android": radAndroid.Checked = true; break; case "rabalac": radRabalac.Checked = true; break; default: break; }// end of switch block // About tab rtbAbout.Rtf = @"{\rtf1\pc \qc \b Weather Lion\b0" + @"\line Author: Paul O. Patterson" + @"\line BushBungalo Productions™ 2005 - " + DateTime.Now.Year + @"\line Version: 1.0" + @"\line © All rights reserved" + @"\line\line\ql\par Weather Lion is an ongoing effort to create a desktop weather widget " + @"using the C# programming language as well as other languages as I " + @"continue to grow as a computer programmer.\par0" + @"\line\line\line Praise Ye YAH!!!}"; // ensure that the changes list is empty (comment out during testing) WeatherLionMain.runningWidget.preferenceUpdated.Clear(); LoadKnownPlaces(); }// end of method frmPreferences_Load