本文整理汇总了C#中Mono.TextEditor.TextEditorData.FindNext方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.TextEditor.TextEditorData.FindNext方法的具体用法?C# Mono.TextEditor.TextEditorData.FindNext怎么用?C# Mono.TextEditor.TextEditorData.FindNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.TextEditor.TextEditorData
的用法示例。
在下文中一共展示了Mono.TextEditor.TextEditorData.FindNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFindNext
public void TestFindNext ()
{
TextEditorData data = new Mono.TextEditor.TextEditorData ();
data.Document.Text = @"ababab";
data.SearchEngine.SearchRequest.SearchPattern = "ab";
data.Caret.Offset = 0;
SearchResult result = data.FindNext (true);
Assert.AreEqual (0, result.Offset);
Assert.AreEqual (2, result.EndOffset);
Assert.IsFalse (result.SearchWrapped);
Assert.AreEqual (result.Offset, data.SelectionRange.Offset);
Assert.AreEqual (result.Length, data.SelectionRange.Length);
Assert.AreEqual (result.EndOffset, data.Caret.Offset);
result = data.FindNext (true);
Assert.AreEqual (2, result.Offset);
Assert.AreEqual (4, result.EndOffset);
Assert.IsFalse (result.SearchWrapped);
Assert.AreEqual (result.Offset, data.SelectionRange.Offset);
Assert.AreEqual (result.Length, data.SelectionRange.Length);
Assert.AreEqual (result.EndOffset, data.Caret.Offset);
result = data.FindNext (true);
Assert.AreEqual (4, result.Offset);
Assert.AreEqual (6, result.EndOffset);
Assert.IsFalse (result.SearchWrapped);
Assert.AreEqual (result.Offset, data.SelectionRange.Offset);
Assert.AreEqual (result.Length, data.SelectionRange.Length);
Assert.AreEqual (result.EndOffset, data.Caret.Offset);
result = data.FindNext (true);
Assert.AreEqual (0, result.Offset);
Assert.AreEqual (2, result.EndOffset);
Assert.IsTrue (result.SearchWrapped);
Assert.AreEqual (result.Offset, data.SelectionRange.Offset);
Assert.AreEqual (result.Length, data.SelectionRange.Length);
Assert.AreEqual (result.EndOffset, data.Caret.Offset);
}