public bool okButton_validating() { if (!ValidityHelperClass.isInt(respawnTimeTextbox.Text)) { MessageBox.Show("Respawn time can not be parsed to a integer number", "Incorrect respawn time", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isUint(numberOfSpawnsTextbox.Text)) { MessageBox.Show("Number of spanws can not be parsed to a unsigned integer number", "Incorrect number of spawns", MessageBoxButtons.OK); return(false); } else { if ((!ValidityHelperClass.isInt(spawnRadiusTextbox.Text)) && (showRadius)) { MessageBox.Show("Spawn radius can not be parsed to a integer number", "Incorrect spawn radius", MessageBoxButtons.OK); return(false); } } } return(true); }
public bool okButton_validating() { if (!ValidityHelperClass.assetExists(filenameTextBox.Text)) { MessageBox.Show("The filename selected does not exist in the asset repository", "Invalid Filename", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(sizeXTextBox.Text)) { MessageBox.Show("The SizeX entered can not be parsed to a floating point number", "Invalid size", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(sizeZTextBox.Text)) { MessageBox.Show("The SizeZ entered can not be parsed to a floating point number", "Invalid size", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isInt(priorityTextBox.Text)) { MessageBox.Show("The priority entered can not be parsed to an integer number", "Invalid Priority", MessageBoxButtons.OK); return(false); } } } } return(true); }
private void intValidateEvent(object sender, CancelEventArgs e) { if (!ValidityHelperClass.isInt(((TextBox)sender).Text)) { Color textColor = Color.Red; ((TextBox)sender).ForeColor = textColor; } else { Color textColor = Color.Black; ((TextBox)sender).ForeColor = textColor; } }
private void intVerifyevent(object sender, CancelEventArgs e) { TextBox textbox = (TextBox)sender; if (!ValidityHelperClass.isInt(textbox.Text)) { Color textColor = Color.Red; textbox.ForeColor = textColor; } else { Color textColor = Color.Black; textbox.ForeColor = textColor; } }
public bool okButton_validating() { if (String.Equals(ForestDialogSpeedWindFilenameComboBox.Text, "")) { return(false); } else { if (!ValidityHelperClass.isInt(ForestSeedTextBox.Text)) { MessageBox.Show("Random number seed can not be parsed to a integer number", "Incorrect random number seed", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(forestAddDialogWindSpeedTextBox.Text)) { MessageBox.Show("Wind speed can not be parsed to a floating point number", "Incorrect wind speed", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(forestAddDialogWindDirectionXTextBox.Text)) { MessageBox.Show("Wind direction X can not be parsed to a floating point number", "Incorrect wind direction X", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(forestAddDialogWindDirectionYTextBox.Text)) { MessageBox.Show("Wind direction Y can not be parsed to a floating point number", "Incorrect wind direction Y", MessageBoxButtons.OK); return(false); } else { if (!ValidityHelperClass.isFloat(forestAddDialogWindDirectionZTextBox.Text)) { MessageBox.Show("Wind direction Z can not be parsed to a floating point number", "Incorrect wind direction Z", MessageBoxButtons.OK); return(false); } } } } } } return(true); }
public bool okButton_validating() { string text = ValueTextbox.Text; switch (valueType) { case "Float": return(ValidityHelperClass.isFloat(text)); break; case "uInt": return(ValidityHelperClass.isUint(text)); break; case "int": return(ValidityHelperClass.isInt(text)); break; } return(true); }