Exemplo n.º 1
0
        public DefaultCompiledRuleStore(
            ILexer lexer,
            IParser parser,
            IInterpreter interpreter,
            IRuleStore ruleStore)
        {
            if (lexer == null)
            {
                throw new ArgumentNullException(nameof(lexer));
            }

            if (parser == null)
            {
                throw new ArgumentNullException(nameof(parser));
            }

            if (interpreter == null)
            {
                throw new ArgumentNullException(nameof(interpreter));
            }

            if (ruleStore == null)
            {
                throw new ArgumentNullException(nameof(ruleStore));
            }

            _lexer       = lexer;
            _parser      = parser;
            _interpreter = interpreter;
            _ruleStore   = ruleStore;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleManager"/> class.
 /// </summary>
 /// <param name="store">The store that the <see cref="RuleManager" /> operates against.</param>
 public RuleManager(IRuleStore store)
 {
     if (store == null)
     {
         throw new ArgumentNullException(nameof(store));
     }
     Store = store;
 }
Exemplo n.º 3
0
 /// <summary>
 /// If disposing, calls dispose on the Context. Always nulls out the Context
 /// </summary>
 /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing && Store != null)
     {
         // Store.Dispose();
     }
     _disposed = true;
     Store     = null;
 }
Exemplo n.º 4
0
 public DefaultCompiledRuleStore(IRuleStore ruleStore)
     : this(new DefaultLexer(), new DefaultParser(), new DefaultInterpreter(), ruleStore)
 {
 }
Exemplo n.º 5
0
 public RuleEngine(IRuleStore pool, IRuleEvaluationStrategy strategy)
 {
     _pool     = pool;
     _strategy = strategy;
 }
Exemplo n.º 6
0
 public RuleEngine(IRuleStore pool) : this(pool, new SimpleRuleEvaluationStrategy())
 {
 }
Exemplo n.º 7
0
 public RuleBookBuilder()
 {
     _ruleStore = ComponentFactory.Instance.Create <IRuleStore>();
 }
Exemplo n.º 8
0
 public RuleEngine(IRuleStore store)
 {
     _store = store;
 }
Exemplo n.º 9
0
 public TestRuleStore()
 {
     _ruleStore = new DefaultRuleStore();
 }