Exemplo n.º 1
0
        private void ucRightDiff_SnapshotChanged(object sender, EventArgs e)
        {
            ChangeTextAction action = new ChangeTextAction(ucLeftDiff, ucRightDiff,
                                                           _leftSnapshot, ucLeftDiff.GetSnapshot(),
                                                           _rightSnapshot, ucRightDiff.GetSnapshot());

            _undoManager.Do(action);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Replace the text lines in both the left and the right diff edit boxes.
        /// </summary>
        /// <param name="left">The text to place into the left diff edit box</param>
        /// <param name="right">The text to place into the right diff edit box</param>
        public void ReplaceText(string[] left, string[] right)
        {
            _leftSnapshot  = ucLeftDiff.GetSnapshot();
            _rightSnapshot = ucRightDiff.GetSnapshot();

            List <LineRecord> leftrecs  = new List <LineRecord>();
            List <LineRecord> rightrecs = new List <LineRecord>();

            PrepareDiff(left, right, leftrecs, rightrecs);

            ucLeftDiff.Lines  = leftrecs;
            ucRightDiff.Lines = rightrecs;

            UpdateDiffBar();

            ChangeTextAction action = new ChangeTextAction(ucLeftDiff, ucRightDiff,
                                                           _leftSnapshot, ucLeftDiff.GetSnapshot(),
                                                           _rightSnapshot, ucRightDiff.GetSnapshot());

            _undoManager.Do(action);
        }