Esempio n. 1
0
        internal IDiffLineViewModel GotoTextLine(int thisLine)
        {
            DocumentLine line = Document.GetLineByNumber(thisLine);

            TxtControl.SelectText(line.Offset, 0); // Select text with length 0 and scroll to where
            TxtControl.ScrollToLine(thisLine);     // we are supposed to be at

            return(_DocLineDiffs[thisLine - 1]);
        }
Esempio n. 2
0
        /// <summary>
        /// Scrolls the attached view to line <paramref name="n"/>
        /// where n should in the range of [1 ... max lines].
        /// </summary>
        /// <param name="n"></param>
        /// <param name="positionCursor"></param>
        public void ScrollToLine(int n, bool positionCursor)
        {
            DocumentLine line = Document.GetLineByNumber(n);

            if (positionCursor == true)                // Position caret with
            {
                TxtControl.SelectText(line.Offset, 0); // Text Selection length 0 and scroll to where
            }
            TxtControl.ScrollToLine(n);                // we are supposed to be at
        }
Esempio n. 3
0
 /// <summary>
 /// This method is called before a replace all operation.
 /// </summary>
 public void BeginChange()
 {
     TxtControl?.BeginChange();
 }
Esempio n. 4
0
 /// <summary>
 /// This method is called after a replace all operation.
 /// </summary>
 public void EndChange()
 {
     TxtControl?.EndChange();
 }
Esempio n. 5
0
 /// <summary>
 /// Selects the specified portion of Text and scrolls that part into view.
 /// </summary>
 /// <param name="start"></param>
 /// <param name="length"></param>
 public void Select(int start, int length)
 {
     TxtControl?.SelectText(start, length);
 }