internal static bool GetConditionsFlag(List <bool> conditionValues, EConditionOperator conditionOperator, bool invert) { bool flag; if (conditionOperator == EConditionOperator.And) { flag = true; foreach (var value in conditionValues) { flag = flag && value; } } else { flag = false; foreach (var value in conditionValues) { flag = flag || value; } } if (invert) { flag = !flag; } return(flag); }
private static bool GetConditionsFlag(List <bool> conditionValues, EConditionOperator conditionOperator, bool invert) { bool flag; switch (conditionOperator) { case EConditionOperator.And: { flag = true; foreach (var value in conditionValues) { flag = flag && value; } return(invert ? !flag : flag); } case EConditionOperator.Or: { flag = false; foreach (var value in conditionValues) { flag = flag || value; } return(invert ? !flag : flag); } default: throw new InvalidOperationException($"Unknown conditional operator {conditionOperator}"); } }
public HideIfAttribute(EConditionOperator conditionOperator, params string[] conditions) : base(conditionOperator, conditions) { Inverted = true; }
public ShowIfAttributeBase(EConditionOperator conditionOperator, params string[] conditions) { ConditionOperator = conditionOperator; Conditions = conditions; }
public ShowIfAttribute(EConditionOperator conditionOperator, params string[] conditions) : base(conditionOperator, conditions) { Inverted = false; }