コード例 #1
0
        private bool EvaluateScopedSetting(LoggingContext <string> context)
        {
            bool flag = scopeParserFactory.Evaluate(context.Value);

            logger.LogVerbose($"Evaluating scope {context.Value} for setting {context.Context}, result: {flag}");
            return(flag);
        }
コード例 #2
0
        /// <summary>
        /// Handles 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 BoolScopeValue Provide(string key)
        {
            string scope = storage.GetScope(key);

            if (scope != null)
            {
                return(new BoolScopeValue(scopeParserFactory.Evaluate(scope)));
            }
            throw new ScopeParserException("Could not find scope with name: " + key);
        }