private void buttonEditTemplate_Click(object sender, EventArgs e) { using (EditTemplateForm dlg = new EditTemplateForm()) { string s = ""; switch (comboBoxTemplates.SelectedIndex) { case 0: if (string.IsNullOrEmpty(Properties.Settings.Default.GeocacheTemplateHtml)) { s = _viewer._defaultGeocacheTemplateHtml; } else { s = Properties.Settings.Default.GeocacheTemplateHtml; } break; case 1: if (string.IsNullOrEmpty(Properties.Settings.Default.LogTemplateEvenHtml)) { s = _viewer._defaultLogEvenTemplateHtml; } else { s = Properties.Settings.Default.LogTemplateEvenHtml; } break; case 2: if (string.IsNullOrEmpty(Properties.Settings.Default.LogTemplateOddHtml)) { s = _viewer._defaultLogOddTemplateHtml; } else { s = Properties.Settings.Default.LogTemplateOddHtml; } break; } dlg.textBoxTemplate.Text = s; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { s = dlg.textBoxTemplate.Text; switch (comboBoxTemplates.SelectedIndex) { case 0: Properties.Settings.Default.GeocacheTemplateHtml = s; break; case 1: Properties.Settings.Default.LogTemplateEvenHtml = s; break; case 2: Properties.Settings.Default.LogTemplateOddHtml = s; break; } Properties.Settings.Default.Save(); } } }
private void buttonEditTemplate_Click(object sender, EventArgs e) { using (EditTemplateForm dlg = new EditTemplateForm()) { string s = ""; switch (comboBoxTemplates.SelectedIndex) { case 0: if (string.IsNullOrEmpty(PluginSettings.Instance.GeocacheTemplateHtml)) { s = _viewer._defaultGeocacheTemplateHtml; } else { s = PluginSettings.Instance.GeocacheTemplateHtml; } break; case 1: if (string.IsNullOrEmpty(PluginSettings.Instance.LogTemplateEvenHtml)) { s = _viewer._defaultLogEvenTemplateHtml; } else { s = PluginSettings.Instance.LogTemplateEvenHtml; } break; case 2: if (string.IsNullOrEmpty(PluginSettings.Instance.LogTemplateOddHtml)) { s = _viewer._defaultLogOddTemplateHtml; } else { s = PluginSettings.Instance.LogTemplateOddHtml; } break; } dlg.textBoxTemplate.Text = s; if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { s = dlg.textBoxTemplate.Text; switch (comboBoxTemplates.SelectedIndex) { case 0: PluginSettings.Instance.GeocacheTemplateHtml = s; break; case 1: PluginSettings.Instance.LogTemplateEvenHtml = s; break; case 2: PluginSettings.Instance.LogTemplateOddHtml = s; break; } } } }