public HResult GetCurrentSpan(out NiTextSpan span) { span = new NiTextSpan(); try { var caretPosition = _textAreaControl.Caret.Position; span = new NiTextSpan(caretPosition.Line, caretPosition.Column, caretPosition.Line, caretPosition.Column); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public HResult NavigateTo(NiTextSpan span) { return Control.FindTarget.NavigateTo(span); }
public HResult MarkSpan(NiTextSpan span) { return Control.FindTarget.MarkSpan(span); }
public HResult GetCurrentSpan(out NiTextSpan span) { return Control.FindTarget.GetCurrentSpan(out span); }
public HResult NavigateTo(NiTextSpan span) { try { _textAreaControl.Caret.Position = new TextLocation( span.StartIndex, span.StartLine ); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public HResult MarkSpan(NiTextSpan span) { try { var selectionManager = _textAreaControl.SelectionManager; var start = new TextLocation(span.StartIndex, span.StartLine); _textAreaControl.Caret.Position = start; selectionManager.SetSelection( start, new TextLocation(span.EndIndex, span.EndLine) ); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }