Beispiel #1
0
        private ActionRuleCache FindActionRuleCache(DynamicAction action)
        {
            ActionRuleCache actionRuleCache;

            lock (this) {
                if (!_rules.TryGetValue(action, out actionRuleCache))
                {
                    actionRuleCache = new ActionRuleCache();
                    _rules[action]  = actionRuleCache;
                }
            }

            return(actionRuleCache);
        }
Beispiel #2
0
        internal void AddRule <T>(DynamicAction action, object[] args, StandardRule <T> rule)
        {
            ActionRuleCache actionRuleCache = FindActionRuleCache(action);

            actionRuleCache.AddRule <T>(args, rule);
        }
Beispiel #3
0
        internal StandardRule <T> ExecuteRuleAndUpdateSite <T>(CodeContext callerContext, DynamicAction action, object[] args, object site, ref T target, ref RuleSet <T> rules, out object result)
        {
            ActionRuleCache actionRuleCache = FindActionRuleCache(action);

            return(actionRuleCache.ExecuteRuleAndUpdateSite <T>(callerContext, args, site, ref target, ref rules, out result));
        }
Beispiel #4
0
        internal StandardRule <T> FindRule <T>(CodeContext callerContext, DynamicAction action, object[] args)
        {
            ActionRuleCache actionRuleCache = FindActionRuleCache(action);

            return(actionRuleCache.FindRule <T>(callerContext, args));
        }