public void Reset() { this.Context.Reset(); this.ClipContext = null; this.ContentOffset = 0f; this.AtEndOfTextBox = false; this.OmittedLineHeight = 0f; this.CharTrimmedRunWidth = 0; this.ForcedCharTrim = false; }
internal void Reset() { Context.Reset(); ClipContext = null; ContentOffset = 0f; AtEndOfTextBox = false; OmittedLineHeight = 0f; CharTrimmedRunWidth = 0; ForcedCharTrim = false; }
public FlowContext(float width, float height, TextBoxContext context) : this(width, height) { this.Context = context; }
internal void Search(GdiContext context, int paragraphIndex) { if (string.IsNullOrEmpty(context.SearchText)) { m_searchResults = null; m_firstSearchIndex = -1; m_lastSearchIndex = -1; return; } if (m_searchResults != null) { m_searchResults.Clear(); } string text = Text; string text2 = context.SearchText; if (text2.IndexOf(' ') >= 0) { text2 = text2.Replace('\u00a0', ' '); text = text.Replace('\u00a0', ' '); } int num = text.IndexOf(text2, 0, StringComparison.OrdinalIgnoreCase); if (num == -1) { return; } if (context.SearchMatches == null) { context.SearchMatches = new List <SearchMatch>(); } if (m_searchResults == null) { m_searchResults = new List <SearchMatch>(); } m_firstSearchIndex = context.SearchMatches.Count; int num2 = -1; int num3 = 0; string text3 = null; do { num2++; text3 = m_textRuns[num2].Text; }while (string.IsNullOrEmpty(text3) && num2 < m_textRuns.Count); while (num > -1) { while (num > num3 + text3.Length && num2 + 1 < m_textRuns.Count) { num3 += text3.Length; num2++; text3 = m_textRuns[num2].Text; } TextBoxContext textBoxContext = new TextBoxContext(); textBoxContext.ParagraphIndex = paragraphIndex; textBoxContext.TextRunIndex = num2; textBoxContext.TextRunCharacterIndex = num - num3; while (num3 + text3.Length < num + text2.Length && num2 + 1 < m_textRuns.Count) { num3 += text3.Length; num2++; text3 = m_textRuns[num2].Text; } TextBoxContext textBoxContext2 = new TextBoxContext(); textBoxContext2.ParagraphIndex = paragraphIndex; textBoxContext2.TextRunIndex = num2; textBoxContext2.TextRunCharacterIndex = num + text2.Length - num3; SearchMatch searchMatch = new SearchMatch(new RTSelectionHighlight(textBoxContext, textBoxContext2, SystemColors.Highlight)); searchMatch.Point = new PointF(TextPosition.X, TextPosition.Y); m_searchResults.Add(searchMatch); context.SearchMatches.Add(searchMatch); m_lastSearchIndex = context.SearchMatches.Count - 1; num = text.IndexOf(text2, num + text2.Length, StringComparison.OrdinalIgnoreCase); } }
internal FlowContext(float width, float height, TextBoxContext context) : this(width, height) { Context = context; }