예제 #1
0
        public static MultiTrigger Read(XmlNode Node)
        {
            var result = new MultiTrigger();

            result.Triggers = new List <Trigger>();

            foreach (XmlNode triggerNode in Node.ChildNodes)
            {
                if (triggerNode.NodeType == XmlNodeType.Element)
                {
                    switch (triggerNode.Name.ToLower())
                    {
                    case "trigger":

                        var trigger = Trigger.Read(triggerNode);
                        if (trigger != null)
                        {
                            result.Triggers.Add(trigger);
                        }

                        break;
                    }
                }
            }

            return(result);
        }
예제 #2
0
        public static MultiTrigger Read(XmlNode Node)
        {
            var result = new MultiTrigger();
            result.Triggers = new List<Trigger>();

            foreach (XmlNode triggerNode in Node.ChildNodes)
            {
                if (triggerNode.NodeType == XmlNodeType.Element)
                {
                    switch (triggerNode.Name.ToLower())
                    {
                        case "trigger":

                            var trigger = Trigger.Read(triggerNode);
                            if (trigger != null) result.Triggers.Add(trigger);

                            break;
                    }
                }
            }

            return result;
        }
예제 #3
0
        public static Value Read(XmlNode node)
        {
            var result = new Value();

            result.Triggers      = new List <Trigger>();
            result.MultiTriggers = new List <MultiTrigger>();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.NodeType == XmlNodeType.Element)
                {
                    switch (childNode.Name.ToLower())
                    {
                    case "triggers":

                        foreach (XmlNode triggerNode in childNode)
                        {
                            if (triggerNode.NodeType == XmlNodeType.Element)
                            {
                                switch (triggerNode.Name.ToLower())
                                {
                                case "trigger":

                                    var trigger = Trigger.Read(triggerNode);
                                    if (trigger != null)
                                    {
                                        result.Triggers.Add(trigger);
                                    }

                                    break;


                                case "multitrigger":

                                    var multiTrigger = MultiTrigger.Read(triggerNode);
                                    if (multiTrigger != null)
                                    {
                                        result.MultiTriggers.Add(multiTrigger);
                                    }

                                    break;
                                }
                            }
                        }

                        break;

                    case "result":

                        var returnResult = new Return();
                        returnResult.Id = "DEFAULT_ID";

                        if (childNode.Attributes != null)
                        {
                            if (childNode.Attributes["numval"] != null)
                            {
                                returnResult.NumVal = Convert.ToInt16(childNode.Attributes["numval"].Value);
                            }
                        }

                        returnResult.Value = childNode.InnerText;

                        result.Result = returnResult;

                        break;
                    }
                }
            }

            return(result);
        }