Ejemplo n.º 1
0
        private void ScanDocCommentXmlString(LineProgress p)
        {
            while (!p.EndOfLine)
            {
                if (p.Char() == '"')
                {
                    // Only return the attribute value if it should be spell checked
                    if (this.SpellCheckedAttributes.Contains(p.DetermineAttributeName()))
                    {
                        p.EndNaturalText();
                    }
                    else
                    {
                        p.IgnoreSpan();
                    }

                    p.Advance(1);
                    p.State = State.DocCommentXml;

                    return; // Done with string in doc comment XML.
                }

                p.Advance();
            }

            // End of line.  Never found the '"' to close the string, but whatever.  We revert to the
            // DocCommentXml state and ignore the span.
            p.State = State.DocCommentXml;
            p.IgnoreSpan();
        }
Ejemplo n.º 2
0
        private void ScanDocComment(LineProgress p)
        {
            p.StartNaturalText();

            while (!p.EndOfLine)
            {
                if (p.Char() == '<')
                {
                    // Note that we can only ignore an unwanted element if it is contained on the same line.
                    // Elements that can span lines like "code", will still be spell checked here.
                    if (p.NextChar() != '/' || !this.IgnoredXmlElements.Contains(p.DetermineElementName()))
                    {
                        p.EndNaturalText();
                    }
                    else
                    {
                        p.IgnoreSpan();
                    }

                    p.Advance();
                    p.State = State.DocCommentXml;
                    ScanDocCommentXml(p);

                    p.StartNaturalText();
                }
                else
                {
                    p.Advance();
                }
            }

            // End of line.  Record what we have and revert to default state.
            p.EndNaturalText();

            if (p.State == State.DocComment)
            {
                p.State = State.Default;
            }
        }