using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace FCC_Uber_MDX_Configurator { public partial class FunctionPropertiesForm : Form { public FunctionPropertiesForm(bool is_root) { InitializeComponent(); TXT_Name.Enabled = !is_root; } public FunctionPropertiesForm(string input_FunctionID, bool is_root) { InitializeComponent(); TXT_Name.Text = input_FunctionID; //TXT_Name.Enabled = !is_root; this.Update(); } private void BTN_CANCEL_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } private void BTN_SAVE_Click(object sender, EventArgs e) { if (TXT_Name.Text == "") { (new ErrorForm("Invalid Name", "Please enter a name for this function")).ShowDialog(); return; } this.DialogResult = DialogResult.OK; } public string GetFunctionID() { if (TXT_Name.Text != "") { return TXT_Name.Text; } else { return null; } } #region Verify Text Field is Valid private void Leave_VerifyTXTIsNotEmpty(object sender, EventArgs e) { try { TextBox _senderBox = (TextBox)sender; if (_senderBox.Text == "") { ErrorForm _tempErrorForm = new ErrorForm(_senderBox.Name, "The value you entered is not valid"); _tempErrorForm.ShowDialog(); _senderBox.Focus(); } } catch (Exception) { ErrorForm _tempErrorForm = new ErrorForm("Unknown Error", "There was an unexpected untraceable error caught in the application. If you can reproduce this error, please let me know at FusionControlCentre@gmail.com"); _tempErrorForm.ShowDialog(); } } #endregion private void BTN_HELP_NAME_Click(object sender, EventArgs e) { GlobalStaticClass.FireHelpEvent("Function Properties", "Name"); } } }