public static void ParseRule(PushRuleInfo pri,String configurationFile) { XmlDocument doc = new XmlDocument(); string xmlPath = configurationFile; doc.Load(xmlPath); XmlNodeList ruleNodes = doc.SelectNodes("rules/rule"); int ruleNumber = ruleNodes.Count; for (int i = 0; i < ruleNumber; i++) { ArrayList dst = new ArrayList(); XmlNodeList dstNodes = ruleNodes[i].SelectNodes("rules/rule/destination"); for(int k=0;k<dstNodes.Count;k++) { dst.Add(dstNodes[i].InnerText); } pri.PushRules.Add(ruleNodes[i].Attributes["source"].Value,dst); } }
public static void ReloadRule(PushRuleInfo pri,String configurationFile) { pri.PushRules.Clear(); ParseRule(pri,configurationFile); }