/// <summary> /// Gets the controls from the given KmlOptions. /// </summary> /// <param name="options">The KmlOptions to use.</param> private void getControlsFromOptions1(KmlOptions options) { textBoxFileName.Text = options.KmlFileName; textBoxIconScale.Text = options.IconScale.ToString(); textBoxTrkColor.Text = options.TrkColor; textBoxTrkAlpha.Text = options.TrkAlpha; textBoxTrkLinewidth.Text = options.TrkLineWidth.ToString(); comboBoxTrkColorMode.SelectedIndex = comboBoxTrkColorMode.FindString( options.TrkColorMode.ToString()); checkBoxUseTrkIcon.Checked = options.UseTrkIcon; checkBoxUseTrkTrack.Checked = options.UseTrkTrack; checkBoxUseTrkLines.Checked = options.UseTrkLines; textBoxTrkIconUrl.Text = options.TrkIconUrl; textBoxRteColor.Text = options.RteColor; textBoxRteAlpha.Text = options.RteAlpha; textBoxRteLinewidth.Text = options.RteLineWidth.ToString(); comboBoxRteColorMode.SelectedIndex = comboBoxRteColorMode.FindString( options.RteColorMode.ToString()); checkBoxUseRteIcon.Checked = options.UseRteIcon; textBoxRteIconUrl.Text = options.RteIconUrl; textBoxWptColor.Text = options.WptColor; textBoxWptAlpha.Text = options.WptAlpha; textBoxWptLinewidth.Text = options.WptLineWidth.ToString(); comboBoxWptColorMode.SelectedIndex = comboBoxWptColorMode.FindString( options.WptColorMode.ToString()); checkBoxUseWptIcon.Checked = options.UseWptIcon; textBoxWptIconUrl.Text = options.WptIconUrl; checkBoxPromptOverwrite.Checked = options.PromptToOverwrite; checkBoxSendGoogleEarth.Checked = options.SendToGoogleEarth; }
/// <summary> /// Gets the controls from the given KmlOptions. /// </summary> /// <param name="options">The KmlOptions to use.</param> private void getControlsFromOptions(KmlOptions options) { setValidString(textBoxFileName, options.KmlFileName); setValidDouble(textBoxIconScale, options.IconScale); setValidString(textBoxTrkColor, options.TrkColor); setValidString(textBoxTrkAlpha, options.TrkAlpha);; setValidDouble(textBoxTrkLinewidth, options.TrkLineWidth); setValidColorMode(comboBoxTrkColorMode, options.TrkColorMode); checkBoxUseTrkIcon.Checked = options.UseTrkIcon; checkBoxUseTrkTrack.Checked = options.UseTrkTrack; checkBoxUseTrkLines.Checked = options.UseTrkLines; setValidString(textBoxTrkIconUrl, options.TrkIconUrl); setValidString(textBoxRteColor, options.RteColor); setValidString(textBoxRteAlpha, options.RteAlpha); setValidDouble(textBoxRteLinewidth, options.RteLineWidth); setValidColorMode(comboBoxRteColorMode, options.RteColorMode); checkBoxUseRteIcon.Checked = options.UseRteIcon; setValidString(textBoxRteIconUrl, options.RteIconUrl); setValidString(textBoxWptColor, options.WptColor); setValidString(textBoxWptAlpha, options.WptAlpha); setValidDouble(textBoxWptLinewidth, options.WptLineWidth); setValidString(textBoxWptIconUrl, options.WptIconUrl); setValidColorMode(comboBoxWptColorMode, options.WptColorMode); checkBoxUseWptIcon.Checked = options.UseWptIcon; setValidString(textBoxWptIconUrl, options.WptIconUrl); checkBoxPromptOverwrite.Checked = options.PromptToOverwrite; checkBoxSendGoogleEarth.Checked = options.SendToGoogleEarth; }
private void OnOkClick(object sender, System.EventArgs e) { // This is the only place KmlOptions is set. KmlOptions = getOptionsFromDialog(); DialogResult = DialogResult.OK; Visible = false; }
public static KmlOptions getOptionsFromSettings() { KmlOptions options = new KmlOptions(); options.KmlFileName = Properties.KmlSettings.Default.KmlFileName; options.IconScale = Properties.KmlSettings.Default.IconScale; options.TrkColor = Properties.KmlSettings.Default.TrkColor; options.TrkAlpha = Properties.KmlSettings.Default.TrkAlpha; options.TrkLineWidth = Properties.KmlSettings.Default.TrkLineWidth; try { options.TrkColorMode = (KmlColorMode)Enum.Parse( typeof(KmlColorMode), Properties.KmlSettings.Default.TrkColorMode); } catch (Exception ex) { Utils.excMsg("Failed to parse Properties.KmlSettings.Default.TrkColorMode=" + Properties.KmlSettings.Default.TrkColorMode, ex); } options.UseTrkIcon = Properties.KmlSettings.Default.UseTrkIcon; options.UseTrkTrack = Properties.KmlSettings.Default.UseTrkTrack; options.UseTrkLines = Properties.KmlSettings.Default.UseTrkLines; options.TrkIconUrl = Properties.KmlSettings.Default.TrkIconUrl; options.RteColor = Properties.KmlSettings.Default.RteColor; options.RteAlpha = Properties.KmlSettings.Default.RteAlpha; options.RteLineWidth = Properties.KmlSettings.Default.RteLineWidth; try { options.RteColorMode = (KmlColorMode)Enum.Parse( typeof(KmlColorMode), Properties.KmlSettings.Default.RteColorMode); } catch (Exception ex) { Utils.excMsg("Failed to parse Properties.KmlSettings.Default.RteColorMode=" + Properties.KmlSettings.Default.TrkColorMode, ex); } options.UseRteIcon = Properties.KmlSettings.Default.UseRteIcon; options.RteIconUrl = Properties.KmlSettings.Default.RteIconUrl; options.WptColor = Properties.KmlSettings.Default.WptColor; options.WptAlpha = Properties.KmlSettings.Default.WptAlpha; options.WptLineWidth = Properties.KmlSettings.Default.WptLineWidth; try { options.WptColorMode = (KmlColorMode)Enum.Parse( typeof(KmlColorMode), Properties.KmlSettings.Default.WptColorMode); } catch (Exception ex) { Utils.excMsg("Failed to parse Properties.KmlSettings.Default.WptColorMode=" + Properties.KmlSettings.Default.TrkColorMode, ex); } options.UseWptIcon = Properties.KmlSettings.Default.UseWptIcon; options.WptIconUrl = Properties.KmlSettings.Default.WptIconUrl; options.PromptToOverwrite = Properties.KmlSettings.Default.PromptToOverwrite; options.SendToGoogleEarth = Properties.KmlSettings.Default.SendToGoogleEarth; return(options); }
private KmlOptions getOptionsFromDialog() { KmlOptions options = new KmlOptions(); options.KmlFileName = getValidString(textBoxFileName);; options.IconScale = getValidDouble(textBoxIconScale); options.TrkColor = getValidString(textBoxTrkColor); options.TrkAlpha = getValidString(textBoxTrkAlpha);; options.TrkLineWidth = getValidDouble(textBoxTrkLinewidth); options.TrkColorMode = getValidColorMode(comboBoxTrkColorMode); options.UseTrkIcon = checkBoxUseTrkIcon.Checked; options.UseTrkTrack = checkBoxUseTrkTrack.Checked; options.UseTrkLines = checkBoxUseTrkLines.Checked; options.TrkIconUrl = getValidString(textBoxTrkIconUrl); options.RteColor = getValidString(textBoxRteColor); options.RteAlpha = getValidString(textBoxRteAlpha); options.RteLineWidth = getValidDouble(textBoxRteLinewidth); options.RteColorMode = getValidColorMode(comboBoxRteColorMode); options.UseRteIcon = checkBoxUseRteIcon.Checked; options.RteIconUrl = getValidString(textBoxRteIconUrl); options.WptColor = getValidString(textBoxWptColor); options.WptAlpha = getValidString(textBoxWptAlpha); options.WptIconUrl = getValidString(textBoxWptIconUrl); options.WptLineWidth = getValidDouble(textBoxWptLinewidth); options.WptColorMode = getValidColorMode(comboBoxWptColorMode); options.UseWptIcon = checkBoxUseWptIcon.Checked; options.WptIconUrl = getValidString(textBoxWptIconUrl); options.PromptToOverwrite = checkBoxPromptOverwrite.Checked; options.SendToGoogleEarth = checkBoxSendGoogleEarth.Checked; return(options); }
private void OnUseDefaultsClick(object sender, EventArgs e) { KmlOptions options = new KmlOptions(); getControlsFromOptions(options); }
/// <summary> /// CTOR that initializes the controls from the given KmlOptions. /// </summary> /// <param name="options">The KmlOptions to use.</param> public KmlOptionsDialog(KmlOptions options) { InitializeComponent(); getControlsFromOptions(options); }