Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Cmd.Net.Command" /> class using the specified command name and description.
        /// </summary>
        /// <param name="name">The name of a command.</param>
        /// <param name="description">The description of a command.</param>
        /// <exception cref="T:System.ArgumentNullException"><paramref name="name" /> is null.</exception>
        /// <exception cref="T:System.ArgumentException"><paramref name="name" /> is an empty string (""), or contains one or more invalid characters.</exception>
        /// <remarks>
        /// A <paramref name="name" /> can contain letters, digits and underscore characters.
        /// </remarks>
        protected Command(string name, string description)
        {
            CommandHelpers.ValidateName("name", name, false);

            _name        = name;
            _description = description;
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Cmd.Net.VerbAttribute" /> class using the specified command name.
 /// </summary>
 /// <param name="verb">The name for a command.</param>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="verb" /> is null.</exception>
 /// <exception cref="T:System.ArgumentException"><paramref name="verb" /> is an empty string (""), or contains one or more invalid characters.</exception>
 /// <remarks>
 /// A <paramref name="verb" /> can contain letters, digits and underscore characters.
 /// </remarks>
 public VerbAttribute(string verb)
 {
     CommandHelpers.ValidateName("verb", verb, false);
     _verb = verb;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Cmd.Net.ArgumentAttribute" /> class using the specified argument name.
 /// </summary>
 /// <param name="name">The name for an argument.</param>
 /// <exception cref="T:System.ArgumentException"><paramref name="name" /> contains one or more invalid characters.</exception>
 /// <remarks>
 /// A <paramref name="name" /> can be null, an empty string (""), or can contain letters, digits and underscore characters.
 /// </remarks>
 public ArgumentAttribute(string name)
 {
     CommandHelpers.ValidateName("name", name, true);
     _name = name ?? string.Empty;
 }