/// <summary> /// Performs a compare operation using the specified FileComparer with the two files at the specified location. /// </summary> /// <param name="location"></param> public void Compare(ItemLocation location, IFileComparer fileComparer) { File left = Left.GetFileAtLocation(location); File right = Right.GetFileAtLocation(location); //TODO: Show a message saying that one of the files does not exist. if (left == null || right == null) { return; } try { fileComparer.Compare(left, right); } catch (Exception) { } }
internal override void Compare(IFileComparer fileComparer) { CompareStatus status; if (Left == null) { status = CompareStatus.RightOrphant; } else if (Right == null) { status = CompareStatus.LeftOrphant; } else { status = fileComparer.Compare(Left.FullPath, Right.FullPath); } CompareStatuses.Clear(); CompareStatuses.Add(status); }
private void Compare_Click(object sender, RoutedEventArgs e) { if (_firstPath == null || _secondPath == null) { WarningWindow worningWindow = new WarningWindow("Choose two files !!!", this); worningWindow.Show(); } else { try { var result = _fileComparer.Compare(ComparerType.Custom, _firstPath, _secondPath); TextBlock.Text = result; } catch (Exception ex) { TextBlock.Text = ex.Message; } } }