protected IDisposable LocalCallProvider(ICallProvider callProvider) { var old = CallProvider; return(Helpers.Disposable( () => CallProvider = new AggregateCallProvider() .Register(new AggregateCallProvider() .Register(callProvider) .Register(CallProvider)), () => CallProvider = old)); }
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); }