private void InitNavigationState() { ViewModel.CurrentDiff = -1; ViewModel.CurrentDiffLength = 1; firstDiff = -1; lastDiff = -1; ViewModel.EditMode = false; ViewModel.LeftFileDirty = false; ViewModel.LeftFileEdited = false; ViewModel.RightFileDirty = false; ViewModel.RightFileEdited = false; if (ViewModel.LeftFile?.Count > 0 && ViewModel.RightFile?.Count > 0) { UpdateNavigationButtons(); } LeftDiff.Init(); RightDiff.Init(); VerticalFileScrollbar.Value = 0; LeftHorizontalScrollbar.Value = 0; if (firstDiff != -1) { MoveToDiffLine(firstDiff); ViewModel.CurrentDiff = firstDiff; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (!disposed) { disposed = true; LeftDiff?.Dispose(); RightDiff?.Dispose(); } }
private void InitNavigationState() { ViewModel.EditMode = false; ViewModel.LeftFileDirty = false; ViewModel.LeftFileEdited = false; ViewModel.RightFileDirty = false; ViewModel.RightFileEdited = false; currentDiffIndex = -1; UpdateDiffRanges(); LeftDiff.Init(); RightDiff.Init(); VerticalFileScrollbar.Value = 0; LeftHorizontalScrollbar.Value = 0; MoveToFirstDiff(); }
private void CompareFilesFinnished(Task <Tuple <List <Line>, List <Line>, TimeSpan> > task) { Debug.Print("------ CompareFilesFinnished"); progressTimer.Stop(); ViewModel.GuiFrozen = false; if (!BackgroundCompare.CompareCancelled) { ViewModel.LeftFile = new ObservableCollection <Line>(task.Result.Item1); ViewModel.RightFile = new ObservableCollection <Line>(task.Result.Item2); Statusbar.Text = $"Compare time {TimeSpanToShortString(task.Result.Item3)}"; } else { ViewModel.LeftFile = new ObservableCollection <Line>(); ViewModel.RightFile = new ObservableCollection <Line>(); Statusbar.Text = $"Compare cancelled"; } LeftDiff.Focus(); InitNavigationState(); }