/// <summary> /// Align the configuration State of this Action accordingly to the Data. /// </summary> private void ValidateData() { bool pathOk = !String.IsNullOrEmpty(this.FilePath); bool filenameOk = !String.IsNullOrEmpty(this.Filename) && !GenericAction.ContainsIllegalCharacters(this.txtBxFilename.Text) && GenericAction.IsValidFileOrFolderName(this.txtBxFilename.Text); this.txtBxFilePath.BackColor = pathOk ? SystemColors.Window : Color.Orange; this.txtBxFilename.BackColor = filenameOk ? SystemColors.Window : Color.Orange; this.ConfigurationState = (pathOk && filenameOk) ? ConfigurationStates.Configured : ConfigurationStates.Misconfigured; }
/// <summary> /// Align the configuration State of this Action accordingly to the Data. /// </summary> public void ValidateData() { bool folderPathOK = !String.IsNullOrEmpty(this.FolderPath) && !this.FolderPath.EndsWith(@"\"); bool newNameOK = !String.IsNullOrEmpty(this.NewName) && !GenericAction.ContainsIllegalCharacters(this.NewName); this.txtBxFolderPath.BackColor = folderPathOK ? SystemColors.Window : Color.Orange; this.txtBxNewName.BackColor = newNameOK ? SystemColors.Window : Color.Orange; if (folderPathOK && newNameOK) { this.ConfigurationState = ConfigurationStates.Configured; } else { this.ConfigurationState = ConfigurationStates.Misconfigured; } }
/// <summary> /// Align the configuration State of this Action accordingly to the Data. /// </summary> private void ValidateData() { bool pathOK = !String.IsNullOrEmpty(this.FullPath) && !this.FullPath.EndsWith(@"\"); bool newNameOK = !String.IsNullOrEmpty(this.NewName) && GenericAction.IsValidFileOrFolderName(this.NewName) && !GenericAction.ContainsIllegalCharacters(this.NewName); this.txtBxFullPath.BackColor = pathOK ? SystemColors.Window : Color.Orange; this.txtBxNewName.BackColor = newNameOK ? SystemColors.Window : Color.Orange; this.ConfigurationState = (pathOK && newNameOK) ? ConfigurationStates.Configured : ConfigurationStates.Misconfigured; }