mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 14:30:57 +00:00
ac77d9d3a6
- Made TechBot more configurable through .config files - Code refactoring - Removed automatic parameter parsing support to make everyone happy svn path=/trunk/; revision=33586
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System;
|
|
|
|
namespace TechBot.Library
|
|
{
|
|
/// <summary>Implements a basic command-line switch by taking the
|
|
/// switching name and the associated description.</summary>
|
|
/// <remark>Only currently is implemented for properties, so all
|
|
/// auto-switching variables should have a get/set method supplied.</remark>
|
|
[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
|
|
/// <summary>Accessor for retrieving the switch-name for an associated
|
|
/// property.</summary>
|
|
public string Name { get { return m_name; } }
|
|
|
|
/// <summary>Accessor for retrieving the description for a switch of
|
|
/// an associated property.</summary>
|
|
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
|
|
|
|
/// <summary>
|
|
/// Attribute constructor.
|
|
/// </summary>
|
|
public CommandParameterAttribute(string name, string description)
|
|
{
|
|
m_name = name;
|
|
m_description = description;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|