[HEADERS]
[reactos.git] / irc / TechBot / TechBot.Library / Attributes / CommandParameterAttribute.cs
1 using System;
2
3 namespace TechBot.Library
4 {
5 /// <summary>Implements a basic command-line switch by taking the
6 /// switching name and the associated description.</summary>
7 /// <remark>Only currently is implemented for properties, so all
8 /// auto-switching variables should have a get/set method supplied.</remark>
9 [AttributeUsage( AttributeTargets.Property )]
10 public class CommandParameterAttribute : Attribute
11 {
12 #region Private Variables
13 private string m_name = "";
14 private string m_description = "";
15 private bool m_Required = true;
16 private bool m_Default = false;
17 #endregion
18
19 #region Public Properties
20 /// <summary>Accessor for retrieving the switch-name for an associated
21 /// property.</summary>
22 public string Name { get { return m_name; } }
23
24 /// <summary>Accessor for retrieving the description for a switch of
25 /// an associated property.</summary>
26 public string Description { get { return m_description; } }
27
28 public bool Required { get { return m_Required; } }
29
30 public bool DefaultParameter
31 {
32 get { return m_Default; }
33 set { m_Default = value; }
34 }
35
36 #endregion
37
38 #region Constructors
39
40 /// <summary>
41 /// Attribute constructor.
42 /// </summary>
43 public CommandParameterAttribute(string name, string description)
44 {
45 m_name = name;
46 m_description = description;
47 }
48 #endregion
49 }
50 }