private void OnDumpCreated() { if (LeftDump.Dump == null) { return; } if (RightDump.Dump == null) { return; } DBDiff diff = new DBDiff(LeftDump.DumpOptimized, RightDump.DumpOptimized); Dispatcher.InvokeAsync(() => { LeftDump.FillLeftDump(diff); RightDump.FillRightDump(diff); Color foreColor = diff.LeftVersion <= diff.RightVersion ? Colors.Black : Colors.White; Color backColor = diff.LeftVersion <= diff.RightVersion ? Colors.Transparent : Colors.Red; LeftDump.VersionLabel.Foreground = new SolidColorBrush(foreColor); LeftDump.VersionLabel.Background = new SolidColorBrush(backColor); RightDump.VersionLabel.Foreground = new SolidColorBrush(foreColor); RightDump.VersionLabel.Background = new SolidColorBrush(backColor); }); }
public void FillRightDump(DBDiff diff) { Diff = diff; List <TreeInfo> list = new List <TreeInfo>(); foreach (TreeDiff tree in diff.TreeDiffs) { TreeInfo item = new TreeInfo { ID = tree.ClassID, Name = tree.RightClassName, Status = tree.Status }; list.Add(item); } DumpListView.ItemsSource = list; ChangedStack.Visibility = Visibility.Visible; ChangedLabel.Content = Diff.TreeDiffs.Count(t => t.Status == DiffStatus.Changed); RemovedStack.Visibility = Visibility.Collapsed; AddedStack.Visibility = Visibility.Visible; AddedLabel.Content = Diff.TreeDiffs.Count(t => t.Status == DiffStatus.Added); }