/// <summary> /// Constructor /// </summary> /// <param name="caption">Window caption.</param> /// <param name="label">Prompt.</param> /// <param name="validateFunction">Function for validating input.</param> public TextInput(string caption, string label, ValidateFunction validateFunction) : this() { lblPrompt.Text = label; this.Text = caption; _validateFunction = validateFunction; }
/// <summary> /// This function will validate the data in the EditInterface and return /// true if it is valid. It will also fill out errorMessage with any /// errors that may occur. /// </summary> /// <param name="errorMessage">A string that will get an error message for the interface.</param> /// <returns>True if the settings are valid, false if they are not.</returns> public bool validate(out String errorMessage) { if (ValidateFunction != null) { return(ValidateFunction.Invoke(out errorMessage)); } errorMessage = null; return(true); }
public Command(CommandFunction func, ValidateFunction validateFunction = null) { this.func = func; this.validateFunction = validateFunction; }
public ToggleDisplayChannelCommand(CommandFunction func, Channels channel, ValidateFunction validateFunction = null) { this.func = func; this.Channel = channel; }
public void SetUp() { _validateFunction = new ValidateFunction(); }