private void frmMain_Load(object sender, EventArgs e) { //Populate the form with the xml data if it exists //dlgDefaultValuesOrExistingXml(); //get the preset path from the configuration file string path = MapAction.Utilities.getCrashMoveFolderPath(); string filepath = MapAction.Utilities.getOperationConfigFilePath(); //Check if the config file has been set and if it exists if (@path != "" && !MapAction.Utilities.detectOperationConfig()) { //If not, set the dialog to empty tbxPathToCrashMove.Text = "< File moved or deleted: " + path + " >"; } else if (!MapAction.Utilities.detectOperationConfig()) { //If the path is set and file exists, set the textbox to the path tbxPathToCrashMove.Text = string.Empty; } else if (File.Exists(@filepath)) { //If the path is set and file exists, set the textbox to the path tbxPathToCrashMove.Text = @path; populateDialogExistingConfigXml(@filepath); btnSave.Text = "Update XML"; } else { //If the path is set but doesn't exist, return a message to the user in the directory area tbxPathToCrashMove.Text = "other error"; } //Perform validation checks FormValidation.validateOperationName(tbxOperationName, eprOperationNameWarning); FormValidation.validateGlideNumber(tbxGlideNo, eprGlideNoWarning, eprGlideNoError); FormValidation.validateLanguage(cboLanguage, eprLanguageWarning); FormValidation.validateCountry(cboCountry, eprCountryWarning); FormValidation.validateTimezone(cboTimeZone, eprTimezoneWarning, eprTimezoneError); FormValidation.validateOperationID(tbxOperationId, eprOperationIdWarning); FormValidation.validateOrganisation(tbxSourceOrganisation, eprOrganisationWarning); FormValidation.validateUrl(tbxOrganisationUrl, eprUrlWarning); FormValidation.validatePrimaryEmail(tbxPrimaryEmail, eprPrimaryEmailWarning, eprPrimaryEmailError); FormValidation.validateDisclaimer(tbxDislaimerText, eprDisclaimerWarning); FormValidation.validateDonor(tbxDonorText, eprDonorTextWarning); FormValidation.validateExportPath(tbxExportToolPath, eprExportPath); }
private void cboLanguage_TextChanged(object sender, EventArgs e) { FormValidation.validateLanguage(cboLanguage, eprLanguageWarning); }