private ActionRuleCache FindActionRuleCache(DynamicAction action) { ActionRuleCache actionRuleCache; lock (this) { if (!_rules.TryGetValue(action, out actionRuleCache)) { actionRuleCache = new ActionRuleCache(); _rules[action] = actionRuleCache; } } return(actionRuleCache); }
internal void AddRule <T>(DynamicAction action, object[] args, StandardRule <T> rule) { ActionRuleCache actionRuleCache = FindActionRuleCache(action); actionRuleCache.AddRule <T>(args, rule); }
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)); }
internal StandardRule <T> FindRule <T>(CodeContext callerContext, DynamicAction action, object[] args) { ActionRuleCache actionRuleCache = FindActionRuleCache(action); return(actionRuleCache.FindRule <T>(callerContext, args)); }