Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            var exportPath = ConfigurationManager.AppSettings["ExportPath"];

            RuleAdaptor = new RuleAdaptor(exportPath);
        }