Пример #1
0
        /// <summary>
        /// <para>
        /// Executes the validation for the current node and all the child nodes.
        /// </para>
        /// </summary>
        /// <param name="node">
        /// <para>The <see cref="ConfigurationNode"/> to validate.</para>
        /// </param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            ValidationErrorCollection errors = new ValidationErrorCollection();

            Validate(node, errors);
            if (errors.Count > 0)
            {
                foreach (ValidationError error in errors)
                {
                    ConfigurationErrorLogService.LogError(error);
                }
            }
            if (ConfigurationErrorLogService.ValidationErrors.Count > 0)
            {
                if (ConfigurationErrorLogService.ValidationErrors.Count > 0)
                {
                    UIService.DisplayErrorLog(ConfigurationErrorLogService);
                }

                if (reportErrorsOnFailure)
                {
                    UIService.ShowMessage(SR.ValidationErrorsMessage, SR.ValidationCaption);
                }
                ConfigurationErrorLogService.ClearErrorLog();
                validationSucceeded = false;
            }
            else
            {
                validationSucceeded = true;
            }
        }
Пример #2
0
 private void ClearErrorsBeforeExitingCommand()
 {
     if (clearErrorLog == false)
     {
         return;
     }
     ConfigurationErrorLogService.ClearErrorLog();
 }