private void UpdateOtherView(CaretPositionChangedEvent e, IDiffSideViewModel otherView) { if (otherView != null) { switch (e.ChangeType) { case CaretChangeType.ColumnAndLine: otherView.Line = e.Line; otherView.Column = e.Column; break; case CaretChangeType.Column: otherView.Column = e.Column; break; case CaretChangeType.Line: otherView.Line = e.Line; break; default: throw new NotImplementedException(e.ChangeType.ToString()); } } }
/// <summary> /// Is invoked when the cursor position in view A has been changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnViewBCaretPositionChanged(object sender, CaretPositionChangedEvent e) { switch (e.ChangeType) { case CaretChangeType.ColumnAndLine: SynchronizedLine = e.Line; SynchronizedColumn = e.Column; break; case CaretChangeType.Column: SynchronizedColumn = e.Column; break; case CaretChangeType.Line: SynchronizedLine = e.Line; break; default: throw new NotImplementedException(e.ChangeType.ToString()); } if (e.ChangeType == CaretChangeType.Line || e.ChangeType == CaretChangeType.ColumnAndLine) { UpdateViewLineDiff(4); UpdateOtherView(e, ViewA); } }