示例#1
0
        public void Validate()
        {
            Boolean hasErrors = false;

            IList<string> Errors = new List<string>();

            if (name == null  || name.Length < 3)
            {
                hasErrors = true;
                Errors.Add("Name not present or under three characters.");
            }

            if (command == null || command.Length < 3)
            {
                hasErrors = true;
                Errors.Add("Command not present or under three characters.");
            }

            if (arguments == null)
            {
                hasErrors = true;
                Errors.Add("Arguments were not initialized.");
            }

            if (hasErrors)
            {
                ConfigValidationException ex = new ConfigValidationException(Errors);
                throw ex;
            }
        }
 public void HandleErrors(ConfigValidationException ex)
 {
     //
 }