示例#1
0
        private void _loadProject(string projCfg)
        {
            StreamReader r      = File.OpenText(projCfg);
            string       strCfg = r.ReadToEnd();

            r.Close();
            JsonData d = JsonMapper.ToObject(strCfg);

            this._loadNode(d, null);

            string strFileName = Path.GetFileName(projCfg);

            this._tfFileName.text = strFileName;

            //agent category
            BTEntry en     = this.FindEntry();
            int     nIndex = this._lstAgents.FindIndex(x => x == en.AgentCategory);

            this.DDLAgent.popup   = nIndex;
            this.DDLAgent.enabled = false;

            //initialize method define
            MethodDefine.AgentCategory = en.AgentCategory;
            MethodDefine.initMethodDefine();
            //initialize subtree define
            SubTreeDefine.AgentCategory = en.AgentCategory;
            SubTreeDefine.initSubTreeDefine();
        }
示例#2
0
        public void OnBtnEntryClick()
        {
            BTNode node = this.FindEntry() as BTNode;

            if (node == null)
            {
                node = this._instantiate("entry");
                string  strCategory = this.DDLAgent.selectItem;
                BTEntry en          = node as BTEntry;
                en.SetAngentCategory(strCategory);

                //initialize method define
                MethodDefine.AgentCategory = strCategory;
                MethodDefine.initMethodDefine();
                //initialize subtree define
                SubTreeDefine.AgentCategory = strCategory;
                SubTreeDefine.initSubTreeDefine();
                LogUtil.Debug(">>>>>Category:" + MethodDefine.AgentCategory);
                //disable category ddl
                this.DDLAgent.enabled = false;

                this._scrollView.AddChild(node);
            }
        }