private void SetSearched(IEditor editor, string s, bool isFirst, bool isForward) { if (editor.Model is MemoText) { /// MemoTextならフォーカスして検索 editor.RequestSelect(SelectKind.True, true); editor.RequestFocus(FocusKind.Begin, null); var focus = editor.Focus as StyledTextFocus; if (focus != null) { if (!isForward) { /// 最初のcaret位置を一番最後の文字に focus.MoveEndOfText(); } SearchInFocus(focus, s, isFirst, isForward); } } else { /// MemoTextでなければ選択 editor.RequestSelect(SelectKind.True, true); EditorCanvas.EnsureVisible(editor); } }