private static LazyOperand CastAppropiateMulti(IScopeFilterProvider provider, string subkey) { IMultiValueScopeFilterAsyncProvider <BoolScopeValue> result = provider as IMultiValueScopeFilterAsyncProvider <BoolScopeValue>; if (result != null) { return(new LazyOperand(async() => (await result.ProvideAsync(subkey).ConfigureAwait(false)).GetAsyncOperand())); } IMultiValueScopeFilterAsyncProvider <DoubleScopeValue> result2 = provider as IMultiValueScopeFilterAsyncProvider <DoubleScopeValue>; if (result2 != null) { return(new LazyOperand(async() => (await result2.ProvideAsync(subkey).ConfigureAwait(false)).GetAsyncOperand())); } IMultiValueScopeFilterAsyncProvider <StringScopeValue> result3 = provider as IMultiValueScopeFilterAsyncProvider <StringScopeValue>; if (result3 != null) { return(new LazyOperand(async() => (await result3.ProvideAsync(subkey).ConfigureAwait(false)).GetAsyncOperand())); } return(null); }
/// <summary> /// Add a scope filter provider. /// </summary> /// <param name="scopeFilterProvider">A filter provider</param> /// <returns>IRemoteSettings interface for chaining</returns> public IRemoteSettings RegisterFilterProvider(IScopeFilterProvider scopeFilterProvider) { CodeContract.RequiresArgumentNotNull <IScopeFilterProvider>(scopeFilterProvider, "scopeFilterProvider"); scopeParserFactory.ProvidedFilters[scopeFilterProvider.Name] = scopeFilterProvider; return(this); }