예제 #1
0
 public XmlResponseConditionGroup(XmlCommand command, GroupingSymbols symbol, IXmlResponseCondition cond1, IXmlResponseCondition cond2)
 {
     _command = command;
     if (symbol == GroupingSymbols.True || symbol == GroupingSymbols.Or)
     {
         throw new Exception("And 와 Or 속성은 XmlResponseConditionGroup(symbol, cond1, cond2)를 사용하십시오");
     }
     _condition1 = cond1;
     _condition2 = cond2;
 }
예제 #2
0
 public XmlResponseConditionGroup(XmlCommand command, GroupingSymbols symbol)
 {
     _command = command;
     if (symbol == GroupingSymbols.And || symbol == GroupingSymbols.Or)
     {
         throw new Exception("And 와 Or 속성은 XmlResponseConditionGroup(symbol, cond1, cond2)를 사용하십시오");
     }
     else
     {
         GroupingSymbol = symbol;
     }
 }
예제 #3
0
        public void LoadXml(XmlNode rootNode)
        {
            string symbol = XmlGetter.Attribute(rootNode, "Symbol");

            for (int i = 0; i < (int)GroupingSymbols.NULL; i++)
            {
                if (((GroupingSymbols)i).ToString().ToLower().Equals(symbol.ToLower()))
                {
                    GroupingSymbol = (GroupingSymbols)i;
                    break;
                }
            }

            int count = 0;

            foreach (XmlNode respCond in rootNode.ChildNodes)
            {
                if (respCond.Name.Equals("CondGroup"))
                {
                    if (count++ == 0)
                    {
                        _condition1 = new XmlResponseConditionGroup(_command);
                        _condition1.LoadXml(respCond);
                    }
                    else
                    {
                        _condition2 = new XmlResponseConditionGroup(_command);
                        _condition2.LoadXml(respCond);
                    }
                }
                else if (respCond.Name.Equals("Cond"))
                {
                    if (count++ == 0)
                    {
                        _condition1 = new XmlResponseCondition(_command);
                        _condition1.LoadXml(respCond);
                    }
                    else
                    {
                        _condition2 = new XmlResponseCondition(_command);
                        _condition2.LoadXml(respCond);
                    }
                }
            }
        }