public static List <SyncItem> GetListviewSyncItems(ListView listView) { List <SyncItem> syncItems = new List <SyncItem>(); foreach (ListViewItem item in listView.SelectedItems) { SyncItem syncItem = item.Tag as SyncItem; syncItems.Add(syncItem); } return(syncItems); }
public void InitiateDiffTool(SyncItem item) { Process.Start(ConfigSettings.WinMergePath, string.Format("/u {0} {1}", ToQuotes(item.TargetFile), ToQuotes(item.WorkingFile))); }
private void CopyTargetToWorking(SyncItem item) { // copy file File.Copy(item.TargetFile, item.WorkingFile, true); }
public void RemoveSyncItem(SyncItem item) { syncItems.Remove(item); }
public static void WriteMissingFile(RichTextBox richTextBox1, SyncItem item) { richTextBox1.AppendText(string.Format("Missing: {0} - {1}", item.TargetTitle, item.TargetFile)); richTextBox1.AppendText(Environment.NewLine); }
public static void CopyTargetFile(RichTextBox richTextBox1, SyncItem item) { richTextBox1.AppendText(string.Format("copying {0} to {1}", item.TargetFile, item.WorkingFile)); richTextBox1.AppendText(Environment.NewLine); }
public FileCopiedEventArgs(SyncItem item, FileCopyDirection direction) { this.Item = item; this.Direction = direction; }
public static void CreateListviewItem(ListView listView, ImageList imageList, SyncItem item, bool select = false) { string ext = Path.GetExtension(item.TargetFile); if (!imageList.Images.ContainsKey(ext)) { imageList.Images.Add(ext, item.GetAssociatedIcon()); } ListViewItem listItem = new ListViewItem(); listItem.Tag = item; listItem.Text = item.TargetTitle; listItem.ImageKey = AddImageAssociation(imageList, item); listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, item.TargetFile)); listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, item.WorkingFile)); listView.Items.Add(listItem); if (select) { listItem.Selected = true; listItem.Focused = true; listItem.EnsureVisible(); } }
public static void UpdateSelectedListviewItem(ListView listView, ImageList imageList, SyncItem syncItem) { ListViewItem item = listView.SelectedItems[0]; item.ImageKey = AddImageAssociation(imageList, syncItem); item.Text = syncItem.TargetTitle; item.SubItems[1].Text = syncItem.TargetFile; item.SubItems[2].Text = syncItem.WorkingFile; }