asternet/Asterisk.2013/Asterisk.NET/Manager/Action/SetVarAction.cs

84 lines
2.5 KiB
C#
Raw Normal View History

2014-01-08 14:16:39 +00:00
namespace AsterNET.Manager.Action
{
2015-01-03 15:37:29 +00:00
/// <summary>
/// The SetVar action sets the value of a channel variable for a given channel.
/// </summary>
public class SetVarAction : ManagerAction
{
/// <summary> The channel on which to set the variable.</summary>
public string channel;
/// <summary> The name of the variable to set.</summary>
public string varName;
/// <summary> The value to store.</summary>
public string varValue;
/// <summary>
/// Creates a new empty SetVarAction.
/// </summary>
public SetVarAction()
{
}
/// <summary>
/// Creates a new SetVarAction that sets the given global variable to a new value.
/// </summary>
/// <param name="variable">the name of the global variable to set</param>
/// <param name="value">the new value</param>
public SetVarAction(string variable, string value)
{
varName = variable;
varValue = value;
}
/// <summary>
/// Creates a new SetVarAction that sets the given channel variable of the
/// given channel to a new value.
/// </summary>
/// <param name="channel">the name of the channel to set the variable on</param>
/// <param name="variable">the name of the channel variable</param>
/// <param name="value">the new value</param>
public SetVarAction(string channel, string variable, string value)
{
this.channel = channel;
varName = variable;
varValue = value;
}
/// <summary>
/// Get the name of this action, i.e. "SetVar".
/// </summary>
public override string Action
{
get { return "SetVar"; }
}
2015-01-03 15:37:29 +00:00
/// <summary>
/// Get/Set the name of the channel.
/// </summary>
public string Channel
{
get { return channel; }
set { channel = value; }
}
2015-01-03 15:37:29 +00:00
/// <summary>
/// Get/Set the name of the variable to set.
/// </summary>
public string Variable
{
get { return varName; }
set { varName = value; }
}
2015-01-03 15:37:29 +00:00
/// <summary>
/// Get/Set the value to store.
/// </summary>
public string Value
{
get { return varValue; }
set { varValue = value; }
}
}
}