/// <summary> /// The Selected has changed. /// </summary> /// <param name="control"></param> /// <param name="selectedIndex"></param> public void OnTextChanged(Control control, string text) { // cast the control as a LabelTextBoxControl LabelTextBoxControl sender = control as LabelTextBoxControl; // If the SelectedReader object exists if ((this.HasSelectedReader) && (TextHelper.Exists(text))) { // Set the ReaderName SelectedReader.ReaderName = text; SelectedReader.ClassName = text; // if the value for HasOpenProject is true if (HasOpenProject) { // Set the DataWatcherFileName SelectedReader.FileName = Path.Combine(OpenProject.ReaderFolder, text + ".cs"); } // Display the selected custom reader DisplaySelectedCustomReader(); } // Enable controls UIEnable(); }
/// <summary> /// event is fired when On Text Changed /// </summary> public void OnTextChanged(Control control, string text) { // if the value for HasConnectionInfo is true if (HasConnectionInfo) { // cast the control as a LabelTextBox LabelTextBoxControl textBox = control as LabelTextBoxControl; // If the textBox object exists if (NullHelper.Exists(textBox)) { // determine the action by the name switch (textBox.Name) { case "DatabaseServerControl": // Set the value for DatabaseServer ConnectionInfo.DatabaseServer = text; // required break; case "DatabaseNameControl": // Set the value for DatabaseName ConnectionInfo.DatabaseName = text; // required break; case "DatabaseUserControl": // Set the value for DatabaseUserName ConnectionInfo.DatabaseUserName = text; // required break; case "DatabasePasswordControl": // Set the value for DatabasePassword ConnectionInfo.DatabasePassword = text; // required break; case "x": // set the connection string ConnectionInfo.ConnectionString = text; // required break; } } } // Enable or disable ncontrols UIControl(); }
/// <summary> /// The Selected has changed. /// </summary> /// <param name="control"></param> /// <param name="selectedIndex"></param> public void OnTextChanged(Control control, string text) { // first attempt casting the control as LabelTextBoxControl LabelTextBoxControl sender = control as LabelTextBoxControl; // if the sender and Options objects both exist if (NullHelper.Exists(sender, Options)) { // if this is the ResolutionControl if (sender.Name == ResolutionControl.Name) { // Set the Resolution Options.Resolution = NumericHelper.ParseInteger(text, 0, -1); } } // now try LabelTextBoxBrowserControl LabelTextBoxBrowserControl sender2 = control as LabelTextBoxBrowserControl; // if the sender2 and Options objects both exist if (NullHelper.Exists(sender2, Options)) { // verify we have the correct control if (sender2.Name == DirectoryControl.Name) { // Set the Directory Options.Directory = text; } } // Enable or disable the StartButton UIControl(); }
/// <summary> /// event is fired when On Text Changed /// </summary> public void OnTextChanged(Control sender, string text) { // cast the control as a LabelTextBoxControl LabelTextBoxControl textControl = sender as LabelTextBoxControl; // If the textControl object exists if (NullHelper.Exists(textControl, this.Info)) { // if this is the FirstNamesControl if (textControl.Name == this.FirstNamesCountControl.Name) { // Set the FirstNamesCount Info.FirstNamesCount = FirstNamesCountControl.IntValue; } else if (textControl.Name == this.LastNamesCountControl.Name) { // Set the LastNamesCount Info.LastNamesCount = LastNamesCountControl.IntValue; } else if (textControl.Name == PercentApartmentsControl.Name) { // parse out the percent in apartments info.PercentInApartments = PercentApartmentsControl.IntValue; } else if (textControl.Name == PercentUnitNumericControl.Name) { // parse out the percent units numeric info.PercentUnitNumeric = PercentUnitNumericControl.IntValue; } else if (textControl.Name == this.FirstNamesCountControl.Name) { // Set the FirstNamesCount info.FirstNamesCount = FirstNamesCountControl.IntValue; } else if (textControl.Name == this.LastNamesCountControl.Name) { // Set the LastNamesCount info.LastNamesCount = LastNamesCountControl.IntValue; } else if (textControl.Name == this.StreetNamesCountControl.Name) { // Set the StreetNamesCount info.StreetNamesCount = StreetNamesCountControl.IntValue; } else if (textControl.Name == this.ZipCodesCountControl.Name) { // Set the ZipCodesCount info.ZipCodesCount = ZipCodesCountControl.IntValue; } else if (textControl.Name == this.MembersToCreateControl.Name) { // set the MembersToCreate info.MembersToCreate = MembersToCreateControl.IntValue; } } }
/// <summary> /// This event is called by the LabelTextBox controls when a value changes in a textbox. /// </summary> /// <param name="labelTextBoxControl"></param> /// <param name="text"></param> public void OnTextChanged(LabelTextBoxControl labelTextBoxControl, string text) { // if this is the DictionaryPathTextBox if (labelTextBoxControl.Name == "DictionaryPathControl") { // if the text exists if (TextHelper.Exists(text)) { // if the string does not end with the fileName if (!text.EndsWith(@"\CommentDictionary.xml")) { // append the name of the file labelTextBoxControl.Text = text + @"\CommentDictionary.xml"; } } } // enable the controls based upon the value of DictionaryPath or the InstalledVersion UIEnable(); }
/// <summary> /// This method shows a ChipRack and the value is set in the LabelTextBox.Text /// </summary> /// <param name="labelTextBox"></param> public static void ShowChipSelector(LabelTextBoxControl textBox) { // If the textBox object exists if (NullHelper.Exists(textBox)) { // Create a chipSelector control ChipSelectorForm chipSelectorForm = new ChipSelectorForm(); // Show the ChipSelectorForm chipSelectorForm.ShowDialog(); // if the user did not cancel if (!chipSelectorForm.UserCancelled) { // get the amount selected int amountSelected = chipSelectorForm.AmountBet; // set the amount selected textBox.Text = "$" + String.Format("{0:n0}", amountSelected); textBox.Refresh(); } } }
/// <summary> /// The Selected has changed. /// </summary> /// <param name="control"></param> /// <param name="selectedIndex"></param> public void OnTextChanged(Control control, string text) { // set the control as a sender LabelTextBoxControl sender = control as LabelTextBoxControl; // if the value for HasNote is true if ((HasNote) && (NullHelper.Exists(sender))) { // determine the action by the name of the control switch (sender.Name) { case "IdControl": // set the value IdControl.Text = text; // required break; case "TitleControl": // Set the Title Note.Title = text; // required break; case "DescriptionControl": // set the Description Note.Description = text; // required break; } } }
/// <summary> /// The Selected has changed. /// </summary> /// <param name="control"></param> /// <param name="selectedIndex"></param> public void OnTextChanged(Control control, string text) { // cast the sender as a LabelTextBoxControl LabelTextBoxControl sender = control as LabelTextBoxControl; // if the sender exists and there is a SelectedIgnoreFodlerException if ((NullHelper.Exists(sender)) && (this.HasSelectedIgnoreFolderException)) { // if this is the ExceptionNameControl if (sender.Name == "ExceptionNameControl") { // set the name this.SelectedIgnoreFolderException.Name = text; // Display the Exceptions this.DisplayExceptions(this.SelectedIgnoreFolderException); } else if (sender.Name == "ExceptionTextControl") { // set the text this.SelectedIgnoreFolderException.Text = text; } } }