using System;
namespace AnticipatingMinds.Genesis.CodeDOM{
/// <summary>
/// Represents a conditional operator.
/// </summary>
/// <remarks>
/// C# conditional operator is '?' operator.
/// a = b ? e1:e2;
/// </remarks>
[Serializable]
public class CodeConditionalExpression : CodeExpression
{
/// <summary>
/// Initializes new instance of the <see cref="CodeConditionalExpression"/> class.
/// </summary>
public CodeConditionalExpression()
{
}
#region Public instance properties
/// <summary>
/// Gets or sets conditional operaor test condition.
/// </summary>
/// <value>A condition to be tested.</value>
public CodeExpression Condition
{
get
{
return condition;
}
set
{
condition = value;
}
}
/// <summary>
/// Gets or sets a 'true' expression.
/// </summary>
/// <value>An expression that will be executed if condition has been evaluated to true.</value>
public CodeExpression TrueExpression
{
get
{
return trueExpression;
}
set
{
trueExpression = value;
}
}
/// <summary>
/// Gets or sets a 'false' expression.
/// </summary>
/// <value>An expression that will be executed if condition has been evaluated to false.</value>
public CodeExpression FalseExpression
{
get
{
return falseExpression;
}
set
{
falseExpression = value;
}
}
#endregion Public instance properties
#region Private instance fields
private CodeExpression condition;
private CodeExpression trueExpression;
private CodeExpression falseExpression;
#endregion Private instance fields
}
}
|