private static string ManageDelmitter(string condition, IDictionary <string, AbstractConditionPart> dicConditionPart, string startDelimitter, string endDelimitter, Func <string, AbstractConditionPart> extractFunc)
 {
     while (condition.Contains(startDelimitter))
     {
         string subCondition = condition.InfoBetween(startDelimitter, endDelimitter, condition.LastIndexOf(startDelimitter, condition.LastIndexOf(endDelimitter, StringComparison.Ordinal) - 1, StringComparison.Ordinal));
         string g            = NumberGiver.NewNumber();
         dicConditionPart.Add(g, extractFunc(subCondition));
         condition = condition.Replace(startDelimitter + subCondition + endDelimitter, "[" + g + "]");
     }
     return(condition);
 }
        private static string DeserializeGroupOperator(string condition, IDictionary <string, AbstractConditionPart> dicConditionPart, string op, string[] equivalentOperators, ConditionPartOperatorEnum oper)
        {
            int    iOp      = condition.ToUpper().IndexOf(op, StringComparison.Ordinal);
            int    iAfterOp = iOp + op.Length;
            var    left     = Deserialize(condition.Remove(iOp), dicConditionPart);
            var    iNexts   = equivalentOperators.Select(x => condition.ToUpper().IndexOf(x, iAfterOp, StringComparison.Ordinal)).Where(i => i >= 0).ToArray();
            var    iNext    = iNexts.Any() ? iNexts.Min(): condition.Length;
            var    right    = Deserialize(condition.Substring(iAfterOp, iNext - iAfterOp), dicConditionPart);
            string g        = NumberGiver.NewNumber();

            dicConditionPart.Add(g, new OperationConditionPart {
                LeftSide = left, Operator = oper, RightSide = right
            });
            return("[" + g + "]" + (iNext < condition.Length ? condition.Substring(iNext) : ""));
        }