private ListViewItem CreateNewItem(string key, DataSet left, DataSet right) { ListViewItem item = new ListViewItem(); Tag tag = EK.Capture.Dicom.DicomToolKit.Tag.Tail(key); // the first column is the tag item.Text = key; // each subsequent column is added by calling item.SubItems.Add // the second column is the description item.SubItems.Add(tag.Description); if (left.Contains(key)) { item.SubItems.Add(left[key].ToString()); if (right.Contains(key)) { if (!BatchProcessor.ElementsCompare(left[key], right[key])) { item.BackColor = Color.LightGray; } } else { item.Font = new Font(item.Font, FontStyle.Italic); item.ForeColor = Color.Red; } } else { item.SubItems.Add(""); } if (right.Contains(key)) { item.SubItems.Add(right[key].ToString()); if (left.Contains(key)) { if (!BatchProcessor.ElementsCompare(left[key], right[key])) { item.BackColor = Color.LightGray; } } else { item.Font = new Font(item.Font, FontStyle.Italic); item.ForeColor = Color.Red; } } else { item.SubItems.Add(""); } return(item); }
static int Main(string[] args) { int errorlevel = BatchProcessor.Run(args); if (errorlevel == -1) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(args)); } return(errorlevel); }
private void FillListBox() { if (first == null || second == null) { return; } DataSet left = new DataSet(); left.Read(first); DataSet right = new DataSet(); right.Read(second); ArrayList keys = BatchProcessor.CreateMasterList(left, right); try { DiffListView.Clear(); int width = (this.ClientRectangle.Width - 5) / 4; DiffListView.Columns.Add("Tag", width); DiffListView.Columns.Add("Name", width); string title = (first != null && first.Length > 0) ? new FileInfo(first).Name : "untitled"; DiffListView.Columns.Add(title, width); title = (second != null && second.Length > 0) ? new FileInfo(second).Name : "untitled"; DiffListView.Columns.Add(title, width); foreach (string key in keys) { ListViewItem item = CreateNewItem(key, left, right); DiffListView.Items.Add(item); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Problems encountered, " + ex.Message); } }