57 lines
No EOL
1.2 KiB
C#
57 lines
No EOL
1.2 KiB
C#
namespace JD.TeaBoxAddinSystem.Addins.Description.Conditions
|
|
{
|
|
/// <summary>
|
|
/// A condition that implements the AND operator.
|
|
/// </summary>
|
|
internal class AndCondition : CompositeCondition
|
|
{
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="innerConditions"></param>
|
|
public AndCondition(params Condition[] innerConditions)
|
|
: base(innerConditions)
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
/// <summary>
|
|
/// Overriden.
|
|
/// </summary>
|
|
protected override string Separator
|
|
{
|
|
get
|
|
{
|
|
return "&&";
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
/// <summary>
|
|
/// Overriden.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override bool Evaluate()
|
|
{
|
|
foreach (Condition condition in InnerConditions)
|
|
{
|
|
if (condition != null && !condition.Evaluate())
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |