public static FromRegString ( string str ) : |
||
str | string | |
Résultat |
public static List <GroupGatewayRule> GetGatewayRules() { List <GroupGatewayRule> rules = new List <GroupGatewayRule>(); string[] strRules = Settings.Store.GroupGatewayRules; foreach (string str in strRules) { GroupGatewayRule rule = GroupGatewayRule.FromRegString(str); if (rule != null) { rules.Add(rule); } // else // Log error //m_logger.ErrorFormat("Unrecognized registry entry when loading gateway rule, ignoring: {0}", str); } return(rules); }
public static string SaveGatewayRules(List <GroupGatewayRule> rules) { string ret = ""; List <string> strList = new List <string>(); foreach (GroupRule rule in rules) { if (GroupGatewayRule.FromRegString(rule.ToRegString()) == null) { ret += rule + "\n"; m_logger.ErrorFormat("Rule doesn't comply:{0}", rule); } else { strList.Add(rule.ToRegString()); } } Settings.Store.GroupGatewayRules = strList.ToArray(); return(ret); }