コード例 #1
0
 public XmlResponseCondition(XmlCommand command, String fieldName, String symbolText, String value)
 {
     _command   = command;
     Field      = _command.ResponseData.Field(fieldName);
     CondSymbol = GetSymbol(symbolText);
     Value      = value;
 }
コード例 #2
0
 public XmlResponseCondition(XmlCommand command, String fieldName, CondSymbols symbol, String value)
 {
     _command   = command;
     Field      = _command.ResponseData.Field(fieldName);
     CondSymbol = symbol;
     Value      = value;
 }
コード例 #3
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;
 }
コード例 #4
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;
     }
 }
コード例 #5
0
        //ListDic<String, XmlCommand> _packetList = new ListDic<string, XmlCommand>();
        //public ListDic<String, XmlCommand> PacketList { get { return _packetList; } }

        public void LoadXml(XmlDocument xDoc, XmlNode rootNode, Boolean refLoad = false)
        {
            if (rootNode == null) return;
            XmlControlHandler.GetDefaultXmlItemAttributes(rootNode, xDoc, this);

            XmlNode info = XmlGetter.Child(rootNode, Properties.Resources.Scenario_InfoNodeName);
            _info.LoadXml(_xDoc, info);
            
            if(refLoad==false) _itemList.Clear();//초기화
            
            XmlNode xScenItemList = XmlGetter.Child(rootNode, Properties.Resources.Scenario_CommandListNodeName);
            int packetCount = 0;
            int scenCount = 0;
            foreach (XmlNode xScenItem in xScenItemList.ChildNodes)
            {

                if (xScenItem.Name.Equals(Properties.Resources.Scenario_ItemName_ScenarioNodeName))//"Scenario"))
                {
                    scenCount++;
                    XmlScenario scen = new XmlScenario();
                    scen.LoadXml(_xDoc, xScenItem);
                    _itemList.Add(scen);
                }
                else if (xScenItem.Name.Equals(Properties.Resources.Scenario_ItemName_CommandGroupNodeName))//"CommandGroup"))
                {
                    packetCount++;
                    String name = XmlGetter.Attribute(xScenItem, "Name");
                    if (name.Length == 0) throw new Exception("시나리오파일 [" + NowLoadingFile + "]," + packetCount + "번째 Packet 태그에 Name속성이 없습니다.");

                    String template = XmlGetter.Attribute(xScenItem, "Template");
                    if (template.Contains("."))
                    {
                        template = template.Substring(template.LastIndexOf(".")+1);//.의 가장 맨 뒤의 이름만 가져옴..
                    }
                    if (template.Length == 0) throw new Exception("시나리오파일 [" + NowLoadingFile + "]," + packetCount + "번째 Packet 태그(Name=" + name + ")에 Template속성이 없습니다.");

                    XmlTemplate xTemplate = TemplateInfos.This.GetTemplate(template);//._totalTemplates[template];

                    XmlCommand packet = new XmlCommand(name, xTemplate, this);
                    packet.LoadXml(_xDoc, xScenItem);
                    _itemList.Add(packet);
                }
                else if (xScenItem.Name.Equals("Command"))
                {
                    packetCount++;
                    String name = XmlGetter.Attribute(xScenItem, "Name");
                    if (name.Length == 0) throw new Exception("시나리오파일 [" + NowLoadingFile + "]," + packetCount + "번째 Packet 태그에 Name속성이 없습니다.");

                    String template = XmlGetter.Attribute(xScenItem, "Template");
                    if (template.Length == 0) throw new Exception("시나리오파일 [" + NowLoadingFile + "]," + packetCount + "번째 Packet 태그(Name=" + name + ")에 Template속성이 없습니다.");
                    if (template.Contains("."))
                    {
                        template = template.Substring(template.LastIndexOf(".") + 1);
                    }
                    XmlTemplate xTemplate;
                    if ((xTemplate = TemplateInfos.This.GetTemplate(template))!=null)
                    {
                        
                        XmlCommand packet = new XmlCommand(name, xTemplate, this);
                        try
                        {
                            packet.LoadXml(_xDoc, xScenItem);
                        }
                        catch (Exception e)
                        {
                            throw new Exception("Error on Loading Command [" + packet.Name + "]\r\n"+e.Message);
                        }
                        _itemList.Add(packet);
                    }
                    else
                    {
                        throw new Exception("Template " + template + " doesn't exist which should be in Scenario File[" + _filePath + "]");
                    }
                    
                }
            }

        }
コード例 #6
0
 private XmlResponseConditionGroup(XmlCommand command)
 {
     _command = command;
 }
コード例 #7
0
 internal XmlResponseCondition(XmlCommand command)
 {
     _command = command;
 }