Automation.UI.Util.ConditionHelper.ToString C# (CSharp) Method

ToString() public static method

Gets the string representation of the specified condition.
public static ToString ( Condition condition ) : string
condition Condition The condition.
return string
        public static string ToString(Condition condition)
        {
            var type = condition.GetType();
            if (condition == Condition.TrueCondition)
                return "TRUE";
            if (condition == Condition.FalseCondition)
                return "FALSE";
            if (type == typeof(NotCondition))
                return "NOT " + ToString(((NotCondition) condition).Condition);
            if (type == typeof(OrCondition))
                return string.Join(" OR ", ((OrCondition) condition).GetConditions().Select(ToString).ToList());
            if (type == typeof(AndCondition))
                return string.Join(" AND ", ((AndCondition) condition).GetConditions().Select(ToString).ToList());
            if (type == typeof(StringPropertyCondition))
                return ToString((StringPropertyCondition) condition);
            if (type == typeof(PropertyCondition))
                return ToString((PropertyCondition) condition);
            // Don't know how to print any other conditions.
            throw new NotSupportedException("Condition '" + type + "' not supported");
        }

Same methods

ConditionHelper::ToString ( PropertyCondition condition ) : string
ConditionHelper::ToString ( StringPropertyCondition condition ) : string