void AddRule(ObfuscationAttributeInfo attr, Rules rules) { Debug.Assert(attr.FeatureName != null && attr.FeatureName.StartsWith("@")); var pattern = attr.FeatureName.Substring(1); PatternExpression expr; try { expr = new PatternParser().Parse(pattern); } catch (Exception ex) { throw new Exception("Error when parsing pattern " + pattern + " in ObfuscationAttribute", ex); } var ruleAdaptor = new RuleAdaptor(pattern); try { new ObfAttrParser(protections).ParseProtectionString(ruleAdaptor, attr.FeatureValue); } catch (Exception ex) { throw new Exception("Error when parsing rule " + attr.FeatureValue + " in ObfuscationAttribute", ex); } rules.Add(ruleAdaptor.Rule, expr); }
public MainForm() { InitializeComponent(); var exportPath = ConfigurationManager.AppSettings["ExportPath"]; RuleAdaptor = new RuleAdaptor(exportPath); }