private async Task <bool> EvaluateScopedSettingAsync(LoggingContext <string> context) { bool flag = await scopeParserFactory.EvaluateAsync(context.Value); logger.LogVerbose($"Evaluating scope {context.Value} for setting {context.Context}, result: {flag}"); return(flag); }
/// <summary> /// Handles async requests for Scope.NameOfScope /// </summary> /// <param name="key">The name of the Scope to evaluate.</param> /// <returns>A True <see cref="T:Coding4Fun.VisualStudio.RemoteSettings.BoolScopeValue" /> if the Scope evaluates to True.</returns> public async Task <BoolScopeValue> ProvideAsync(string key) { string scope = storage.GetScope(key); if (scope != null) { return(new BoolScopeValue(await scopeParserFactory.EvaluateAsync(scope).ConfigureAwait(false))); } throw new ScopeParserException("Could not find scope with name: " + key); }