Esempio n. 1
0
        protected IDisposable LocalCallProvider(ICallProvider callProvider)
        {
            var old = CallProvider;

            return(Helpers.Disposable(
                       () => CallProvider = new AggregateCallProvider()
                                            .Register(new AggregateCallProvider()
                                                      .Register(callProvider)
                                                      .Register(CallProvider)),
                       () => CallProvider = old));
        }
Esempio n. 2
0
        private FormulaCompiler With(ICallProvider provider)
        {
            if (CallProvider == null)
            {
                CallProvider = provider;
            }
            else
            {
                if (CallProvider is AggregateCallProvider)
                {
                    ((AggregateCallProvider)CallProvider).Register(provider);
                }
                else
                {
                    CallProvider = new AggregateCallProvider()
                                   .Register(CallProvider)
                                   .Register(provider);
                }
            }

            return(this);
        }