/// <summary>
        /// Adds a message.
        /// </summary>
        /// <param name="message">The message to add.</param>
        public void Add(TidyMessage message)
        {
            if (message.Level == MessageLevel.Error)
            {
                _errors++;
            }
            else if (message.Level == MessageLevel.Warning)
            {
                _warnings++;
            }

            InnerList.Add(message);
        }
        /// <summary>
        /// Adds a message.
        /// </summary>
        /// <param name="message">The message to add.</param>
        public void Add(TidyMessage message)
        {
            if (message.Level == MessageLevel.Error)
            {
                _errors++;
            }
            else if (message.Level == MessageLevel.Warning)
            {
                _warnings++;
            }

            InnerList.Add(message);
        }
Exemple #3
0
        public static void ErrorSummary(Lexer lexer)
        {
            /* adjust badAccess to that its null if frames are ok */
            if ((lexer.badAccess & (USING_FRAMES | USING_NOFRAMES)) != 0)
            {
                if (!(((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0)))
                {
                    lexer.badAccess &= ~(USING_FRAMES | USING_NOFRAMES);
                }
            }

            if (lexer.badChars != 0)
            {
                if ((lexer.badChars & WINDOWS_CHARS) != 0)
                {
                    AddMessage(lexer, GetMessage("badchars_summary"), MessageLevel.Info);
                }
            }

            if (lexer.badForm != 0)
            {
                AddMessage(lexer, GetMessage("badform_summary"), MessageLevel.Info);
            }

            if (lexer.badAccess != 0)
            {
                if ((lexer.badAccess & MISSING_SUMMARY) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_summary"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_IMAGE_ALT) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_image_alt"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_IMAGE_MAP) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_image_map"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_LINK_ALT) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_link_alt"), MessageLevel.Info);
                }

                if (((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0))
                {
                    AddMessage(lexer, GetMessage("badaccess_frames"), MessageLevel.Info);
                }

                TidyMessage msg2 = new TidyMessage(lexer, String.Format(GetMessage("badaccess_summary"), ACCESS_URL), MessageLevel.Info);
                lexer.messages.Add(msg2);
            }

            if (lexer.badLayout != 0)
            {
                if ((lexer.badLayout & USING_LAYER) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_layer"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_SPACER) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_spacer"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_FONT) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_font"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_NOBR) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_nobr"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_BODY) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_body"), MessageLevel.Info);
                }
            }
        }
Exemple #4
0
        public static void ErrorSummary(Lexer lexer)
        {
            /* adjust badAccess to that its null if frames are ok */
            if ((lexer.badAccess & (USING_FRAMES | USING_NOFRAMES)) != 0)
            {
                if (!(((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0)))
                {
                    lexer.badAccess &= ~(USING_FRAMES | USING_NOFRAMES);
                }
            }

            if (lexer.badChars != 0)
            {
                if ((lexer.badChars & WINDOWS_CHARS) != 0)
                {
                    AddMessage(lexer, GetMessage("badchars_summary"), MessageLevel.Info);
                }
            }

            if (lexer.badForm != 0)
            {
                AddMessage(lexer, GetMessage("badform_summary"), MessageLevel.Info);
            }

            if (lexer.badAccess != 0)
            {
                if ((lexer.badAccess & MISSING_SUMMARY) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_summary"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_IMAGE_ALT) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_image_alt"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_IMAGE_MAP) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_image_map"), MessageLevel.Info);
                }

                if ((lexer.badAccess & MISSING_LINK_ALT) != 0)
                {
                    AddMessage(lexer, GetMessage("badaccess_missing_link_alt"), MessageLevel.Info);
                }

                if (((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0))
                {
                    AddMessage(lexer, GetMessage("badaccess_frames"), MessageLevel.Info);
                }

                TidyMessage msg2 = new TidyMessage(lexer, String.Format(GetMessage("badaccess_summary"), ACCESS_URL), MessageLevel.Info);
                lexer.messages.Add(msg2);
            }

            if (lexer.badLayout != 0)
            {
                if ((lexer.badLayout & USING_LAYER) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_layer"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_SPACER) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_spacer"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_FONT) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_font"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_NOBR) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_nobr"), MessageLevel.Info);
                }

                if ((lexer.badLayout & USING_BODY) != 0)
                {
                    AddMessage(lexer, GetMessage("badlayout_using_body"), MessageLevel.Info);
                }
            }
        }