示例#1
0
        //rather than refactoring the fx parser build the dictionary here
        public void buildBhvrOvrDic()
        {
            eBhvrOverrideDic.Clear();

            foreach (string str in eBhvrOverrides)
            {
                bool   isComment = str.StartsWith("#");
                string tmpStr    = str;

                //haldle comment by stripping the first # char
                if (isComment)
                {
                    tmpStr = tmpStr.Substring(1).Trim();
                }

                if (tmpStr.Trim().Length > 0 && tmpStr.IndexOf(' ') != -1)
                {
                    string tagStr = BehaviorParser.fixBhvrKeys(tmpStr.Substring(0, tmpStr.IndexOf(' ')).Trim());

                    string tagVal = tmpStr.Substring(tagStr.Length).Trim();

                    eBhvrOverrideDic[tagStr] = isComment ? ("#" + tagVal) : tagVal;
                }
            }
        }
示例#2
0
        private void updateBhvr()
        {
            ArrayList data = getData();

            Behavior bhvr = BehaviorParser.parse(fileName, ref data);

            foreach (KeyValuePair <string, object> kvp in bhvr.bParameters)
            {
                this.BhvrTag.bParameters[kvp.Key] = kvp.Value;
            }
        }
示例#3
0
        public void loadStandAloneBhvrFile(string file_name)
        {
            ArrayList bhvrData = new ArrayList();

            common.COH_IO.fillList(bhvrData, file_name);

            Behavior bhvr = BehaviorParser.parse(file_name, ref bhvrData);

            bpcfPanel.bhvrStandAloneFile.Add(bhvr);

            if (!bpcfPanel.eventsComboBx.Items.Contains("StandAloneFiles"))
            {
                this.bpcfPanel.eventsComboBx.Items.Add("StandAloneFiles");
            }

            bpcfPanel.eventsComboBx.SelectedIndex = bpcfPanel.eventsComboBx.Items.Count - 1;

            bpcfPanel.eventsBhvrFilesMComboBx.SelectedIndex = bpcfPanel.eventsBhvrFilesMComboBx.Items.Count - 1;
        }
        private void updateBhvr(string fileName, ArrayList data)
        {
            Behavior bhvr = BehaviorParser.parse(fileName, ref data);

            BehaviorWin bWin = (BehaviorWin)ownerDockablePanel;

            foreach (KeyValuePair <string, object> kvp in bhvr.bParameters)
            {
                bWin.BhvrTag.bParameters[kvp.Key] = kvp.Value;
            }

            bWin.BhvrTag.fileName = bhvr.fileName;

            bWin.BhvrTag.isCommented = bhvr.isCommented;

            bWin.BhvrTag.isDirty = bhvr.isDirty;

            bWin.BhvrTag.isP4 = bhvr.isP4;

            bWin.BhvrTag.isReadOnly = bhvr.isReadOnly;

            ((BehaviorWin)ownerDockablePanel).setIsDirty(false);
        }