Microsoft.VisualStudio.Language.Spellchecker.LineProgress.EndNaturalText C# (CSharp) Method

EndNaturalText() public method

public EndNaturalText ( ) : void
return void
        public void EndNaturalText()
        {
            Debug.Assert(naturalTextStart != -1, "Called EndNaturalText() without StartNaturalText()?");
            if (_naturalTextSpans != null && _linePosition > naturalTextStart)
            {
                _naturalTextSpans.Add(new SnapshotSpan(_snapshotLine.Start + naturalTextStart, _linePosition - naturalTextStart));
            }
            naturalTextStart = -1;
        }

Usage Example

Example #1
0
        private void ScanString(LineProgress p)
        {
            p.StartNaturalText();

            while (!p.EndOfLine)
            {
                if (p.Char() == '\\') // escaped character.  Skip over it.
                {
                    p.Advance(2);
                }
                else if (p.Char() == '"') // end of string.
                {
                    p.EndNaturalText();
                    p.Advance();
                    p.State = State.Default;

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

            // End of line.  String wasn't closed.  Oh well.  Revert to Default state.
            p.EndNaturalText();
            p.State = State.Default;
        }
All Usage Examples Of Microsoft.VisualStudio.Language.Spellchecker.LineProgress::EndNaturalText