示例#1
0
        private void parseRules(string strRulesToParse, Version version)
        {
            string[] strArrayRules = strRulesToParse.Trim().Split(new string[] { ">> ", ">>", " <<", "<<" }, StringSplitOptions.RemoveEmptyEntries);


            for (int i = 0; i < strArrayRules.Length; i++)
            {
                if (strArrayRules[i].Trim() != "")
                {
                    string sRuleToParse = strArrayRules[i];

                    dmRule tmpRule = new dmRule(sRuleToParse, version);

                    Rules.Add(tmpRule);
                }
            }
        }
示例#2
0
        public void Parse(string strTemplate, ParameterType dmParameterType)
        {
            string[] tmpParameters = strTemplate.Split(new string[] { ">>,<<", "<<", ">>" }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < tmpParameters.Length; i++)
            {
                DataManagerGUI.dmParameters tmpParameterItem = null;
                switch (dmParameterType)
                {
                case ParameterType.Rule:
                    tmpParameterItem = new dmRule(tmpParameters[i]);
                    break;

                case ParameterType.Action:
                    tmpParameterItem = new dmAction(tmpParameters[i]);
                    break;
                }

                this.Items.Add(tmpParameterItem);
            }
        }
示例#3
0
        private void parseRules(string strRulesToParse)
        {
            if (strRulesToParse.StartsWith("<<"))
            {
                string[] strArrayRules = strRulesToParse.Trim().Split(new string[] { ">> ", ">>", " <<", "<<" }, StringSplitOptions.RemoveEmptyEntries);

                for (int i = 0; i < strArrayRules.Length; i++)
                {
                    if (strArrayRules[i].Trim() != "")
                    {
                        string sRuleToParse = strArrayRules[i];

                        dmRule tmpRule = new dmRule(sRuleToParse);

                        Rules.Add(tmpRule);
                    }
                }
            }
            else
            {
                throw new Exception("Syntax error");
            }
        }
示例#4
0
 public void AddRule(dmRule rule)
 {
     Rules.Add(rule);
 }