本文整理汇总了C#中MonoTextEditor.GetTextBetween方法的典型用法代码示例。如果您正苦于以下问题:C# MonoTextEditor.GetTextBetween方法的具体用法?C# MonoTextEditor.GetTextBetween怎么用?C# MonoTextEditor.GetTextBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTextEditor
的用法示例。
在下文中一共展示了MonoTextEditor.GetTextBetween方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowFor
public void ShowFor(MonoTextEditor editor, bool replaceMode)
{
Editor = editor;
window1.TransientFor = Editor.Toplevel as Window;
Mono.TextEditor.Selection selected = Editor.MainSelection;
if (Editor.SelectedText != null)
{
if (selected.MaxLine == selected.MinLine)
txtLookFor.Text = Editor.SelectedText;
else
Editor.SearchEngine.SearchRequest.SearchRegion = Editor.SelectionRange;
}
else
{
// Get the current word that the caret is on
Caret caret = Editor.Caret;
int start = Editor.GetTextEditorData().FindCurrentWordStart(caret.Offset);
int end = Editor.GetTextEditorData().FindCurrentWordEnd(caret.Offset);
txtLookFor.Text = Editor.GetTextBetween(start, end);
}
ReplaceMode = replaceMode;
window1.Parent = editor.Toplevel;
window1.Show();
//txtLookFor.SelectAll();
txtLookFor.GrabFocus();
}