LineBreaksBeforePosition() public static method

Determines number of line breaks before position
public static LineBreaksBeforePosition ( ITextIterator iterator, int position ) : int
iterator ITextIterator
position int
return int
Esempio n. 1
0
        public int CopyPrecedingLineBreaks(ITextIterator iterator, int position)
        {
            int lineBreakCount     = Whitespace.LineBreaksBeforePosition(iterator, position);
            int recentlyAddedCount = RecentlyAddedLineBreakCount();
            int breaks             = lineBreakCount - recentlyAddedCount;

            for (int i = 0; i < breaks; i++)
            {
                HardLineBreak();
            }

            return(breaks);
        }
Esempio n. 2
0
 private int RecentlyAddedLineBreakCount()
 {
     return(Whitespace.LineBreaksBeforePosition(new StringBuilderIterator(_formattedText), _formattedText.Length));
 }