示例#1
0
        public void LoadXml(XmlDocument xDoc, XmlNode rootNode, Boolean refLoad = false)
        {
            if (rootNode == null)
            {
                return;
            }
            _xDoc = xDoc;  XmlControlHandler.GetDefaultXmlItemAttributes(rootNode, xDoc, this);

            NowLoading = this;
            _matchItem = XmlMatchItem.NowLoading;

            foreach (XmlNode child in rootNode.ChildNodes)
            {
                if (child.Name.Equals("Condition"))
                {
                    XmlNode      condNode = XmlHandlers.XmlGetter.FirstChild(child);
                    XmlCondition cond     = XmlCondition.New(condNode.Name);
                    cond.LoadXml(xDoc, condNode, refLoad);
                    _condition = cond;
                }
                else if (child.Name.Equals("Component"))
                {
                    XmlMatchComponent comp = new XmlMatchComponent();
                    comp.LoadXml(xDoc, child);
                    _components.Add(comp);
                }
            }
            if (_condition == null)
            {
                _condition = XmlCondition.New(XmlConditionTypes.True);                     //default condition
            }
        }
示例#2
0
        public void LoadXml(XmlDocument xDoc, XmlNode rootNode, Boolean refLoad = false)
        {
            if (rootNode == null)
            {
                return;
            }
            XmlControlHandler.GetDefaultXmlItemAttributes(rootNode, xDoc, this);

            this.Clear();
            if (rootNode == null)
            {
                throw new Exception("올바른 Actions Tag가 아닙니다. 루트가 Actions 가 아닙니다. ");
            }
            for (int i = 0; i < rootNode.ChildNodes.Count; i++)
            {
                XmlNode xChild = rootNode.ChildNodes[i];
                if (xChild.Name.Equals("Condition"))
                {
                    XmlNode condNode = xChild.FirstChild;
                    Condition = XmlCondition.New(condNode.Name);
                    Condition.LoadXml(xDoc, xChild);
                }
                else if (xChild.Name.Equals("ComponentCondition"))
                {
                    ComCondition = XmlComConditions.New();//현재 loading중인 conmponent의 고유 ComponentCondition을 가져온다.
                    ComCondition.LoadXml(xDoc, xChild);
                }
                else
                {
                    XmlNode   xAction = xChild;
                    XmlAction action  = new XmlAction();
                    action.LoadXml(xDoc, xAction);
                    this.Add(action);
                }
            }
        }