コード例 #1
0
        /// <summary>
        /// Extracts an object literal that was specified in a configuration function.
        /// </summary>
        public static bool TryExtractConfigurationLiteral(
            this ISourceFile sourceFile,
            out IObjectLiteralExpression literal, out string failureReason)
        {
            List <IObjectLiteralExpression> literals;

            if (!sourceFile.TryExtractLiterals(
                    functionName: Names.ConfigurationFunctionCall,
                    allowMultipleLiterals: false,
                    literals: out literals,
                    failureReason: out failureReason))
            {
                literal = null;
                return(false);
            }

            literal = literals.First();
            return(true);
        }