예제 #1
0
            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);
                }
            }
예제 #2
0
 public HResult NavigateTo(NiTextSpan span)
 {
     return Control.FindTarget.NavigateTo(span);
 }
예제 #3
0
 public HResult MarkSpan(NiTextSpan span)
 {
     return Control.FindTarget.MarkSpan(span);
 }
예제 #4
0
 public HResult GetCurrentSpan(out NiTextSpan span)
 {
     return Control.FindTarget.GetCurrentSpan(out span);
 }
예제 #5
0
            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);
                }
            }
예제 #6
0
            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);
                }
            }