Ejemplo n.º 1
0
        /// <summary>The <see cref="PageNode"/> visit implementation</summary>
        /// <param name="pageNode">The page AST node</param>
        /// <returns>The modified AST node if modified otherwise the original node</returns>
        public override AstNode VisitPageNode(PageNode pageNode)
        {
            if (pageNode == null)
            {
                throw new ArgumentNullException("pageNode");
            }

            // Note - "@page" string cannot be verified here as it is analyzed during the parsing.
            // The print visitors convert it to lower case "@page" after printing.
            try
            {
                // Validate the pseudo nodes on page for lower case
                ValidateForLowerCase(pageNode.PseudoPage);

                // Visit declarations
                pageNode.Declarations.ForEach(declarationNode => declarationNode.Accept(this));
            }
            catch (BuildWorkflowException exception)
            {
                throw new WorkflowException(string.Format(CultureInfo.CurrentUICulture, CssStrings.CssLowercaseValidationParentNodeError, pageNode.PrettyPrint()), exception);
            }

            return(pageNode);
        }