Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        /// <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;
        }