using System;
namespace TechBot.Library
{
/// Implements a basic command-line switch by taking the
/// switching name and the associated description.
/// Only currently is implemented for properties, so all
/// auto-switching variables should have a get/set method supplied.
[AttributeUsage( AttributeTargets.Property )]
public class CommandParameterAttribute : Attribute
{
#region Private Variables
private string m_name = "";
private string m_description = "";
private bool m_Required = true;
private bool m_Default = false;
#endregion
#region Public Properties
/// Accessor for retrieving the switch-name for an associated
/// property.
public string Name { get { return m_name; } }
/// Accessor for retrieving the description for a switch of
/// an associated property.
public string Description { get { return m_description; } }
public bool Required { get { return m_Required; } }
public bool DefaultParameter
{
get { return m_Default; }
set { m_Default = value; }
}
#endregion
#region Constructors
///
/// Attribute constructor.
///
public CommandParameterAttribute(string name, string description)
{
m_name = name;
m_description = description;
}
#endregion
}
}