//Update disclaimer tab 2 automated value button //Gets the automated values for Tab 2 and populates each textbox private void btnUpdateAllTab2_Click(object sender, EventArgs e) { Dictionary <string, string> dict = MapAction.PageLayoutProperties.getLayoutTextElements(_pMxDoc, "Main map"); //If the elements are present in the map, update the values if (dict.ContainsKey("donor_credit") == true) { tbxDonorCredit.Text = LayoutToolAutomatedValues.getConfigDonorText(); } if (dict.ContainsKey("timezone") == true) { tbxTimezone.Text = LayoutToolAutomatedValues.getConfigTimezone(); } if (dict.ContainsKey("map_producer") == true) { tbxMapProducer.Text = LayoutToolAutomatedValues.getProducedByText(); } if (dict.ContainsKey("disclaimer") == true) { tbxDisclaimer.Text = LayoutToolAutomatedValues.getConfigDisclaimer(); } }
//Validate individual form elements for tab 2 public static void validateDisclaimer(Control control, ErrorProvider eprWarning, ErrorProvider eprError) { eprWarning.SetIconPadding(control, 33); eprError.SetIconPadding(control, 33); string automatedValue = LayoutToolAutomatedValues.getConfigDisclaimer(); if (validateEmptyField(control, eprWarning)) { if (control.Text.Trim() != automatedValue && control.Text != string.Empty) { eprError.SetIconAlignment(control, ErrorIconAlignment.MiddleRight); eprError.SetError(control, "Text differs from automated value"); } else { eprError.SetError(control, ""); } } else { eprError.SetError(control, ""); validateEmptyField(control, eprWarning); } }
private void btnUpdateDisclaimer_Click(object sender, EventArgs e) { tbxDisclaimer.Text = LayoutToolAutomatedValues.getConfigDisclaimer(); }