Ejemplo n.º 1
0
        public void OnInit(string routeName, RuleExcuter parent, XmlData data)
        {
            RouteName = routeName;

            Executer     = parent;
            NextExcuters = new List <RuleExcuter>();
            foreach (var exeData in data.Childs)
            {
                Type        type     = Type.GetType("CJC.Framework.Rule." + exeData.Node);
                RuleExcuter executer = Activator.CreateInstance(type) as RuleExcuter;
                executer.OnInit(Executer.mRule, exeData);
                NextExcuters.Add(executer);
            }
        }
Ejemplo n.º 2
0
        public CRule(XmlData data)
        {
            RuleID = ToolParser.IntParse(data.GetAttribute(ERuleKey.ID));
            XmlData main = data.SearchChild((XmlData _data) => { return(ERuleKey.Main.Equals(_data.Node)); });

            if (null == main)
            {
                return;
            }

            EnteranceExcuters = new Dictionary <int, RuleExcuter>();
            foreach (var exeData in main.Childs)
            {
                Type        type   = Type.GetType("CJC.Framework.Rule." + exeData.Node);
                RuleExcuter branch = Activator.CreateInstance(type) as RuleExcuter;
                branch.OnInit(this, exeData);

                EnteranceExcuters.Add(branch.BranchID, branch);
            }
        }