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); } } }
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); } }
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"); } }
public void AddRule(dmRule rule) { Rules.Add(rule); }