コード例 #1
0
 public override int GetCount()
 {
     return(Condition1.GetCount() + Condition2.GetCount());
 }
コード例 #2
0
        public override string GetCns(int index)
        {
            Index = index;
            string conditionSeparator;

            switch (ConditionType)
            {
            case (ConditionType.And):
                conditionSeparator = "_a_";
                break;

            case (ConditionType.Or):
                conditionSeparator = "_o_";
                break;

            default:
                throw new Exception("ConditionType not supported");
            }

            if (index == 0)
            {
                return(Condition1.GetCns(index) + conditionSeparator + Condition2.GetCns(index + Condition1.GetCount()));
            }

            return("(" + Condition1.GetCns(index) + conditionSeparator + Condition2.GetCns(index + Condition1.GetCount()) + ")");
        }