67 lines
1.3 KiB
C#
67 lines
1.3 KiB
C#
using System;
|
|
|
|
namespace JD.TeaBoxAddinSystem.Bootstrap
|
|
{
|
|
/// <summary>
|
|
/// An argument switch, possibly including a value.
|
|
/// </summary>
|
|
[Serializable]
|
|
public class ArgumentSwitch : Argument
|
|
{
|
|
#region Variables
|
|
|
|
private readonly string m_value;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
public ArgumentSwitch(string name)
|
|
: this(name, null)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
/// <param name="value"></param>
|
|
public ArgumentSwitch(string name, string value)
|
|
:base(name)
|
|
{
|
|
m_value = value;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
/// <summary>
|
|
/// Value.
|
|
/// </summary>
|
|
public string Value
|
|
{
|
|
get
|
|
{
|
|
return m_value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this argument switch has a value.
|
|
/// </summary>
|
|
public bool IsEmpty
|
|
{
|
|
get
|
|
{
|
|
return string.IsNullOrEmpty(Value);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|