Beispiel #1
0
 void LoadListToListView()
 {
     listView.Items.Clear();
     try
     {
         foreach (string file in ListFiles)
         {
             if (System.IO.File.Exists(file))
             {
                 itemMovie _item = new itemMovie(file);
                 AddItemToListView(_item);
             }
         }
     } catch (Exception ex)
     {
         Debug.WriteLine("LoadListToListView : " + ex.Message);
     }
 }
Beispiel #2
0
 private void AddItemToListView(itemMovie item)
 {
     if (this.InvokeRequired)
     {
         AddItemToListHandler call =
             new AddItemToListHandler(AddItemToListView);
         this.Invoke(call, new object[] { item });
     }
     else
     {
         Debug.WriteLine($"Add item: {item.NameFile}");
         ListViewItem listviewitem =
             new ListViewItem(item.NameFile);
         listviewitem.Tag = item;
         listviewitem.SubItems.Add("Time").Text    = item.Time.ToString();
         listviewitem.SubItems.Add("Frames").Text  = item.Frames.ToString();
         listviewitem.SubItems.Add("Ratio").Text   = item.Ratio.ToString();
         listviewitem.SubItems.Add("Process").Text = "OK";
         listView.Items.Add(listviewitem);
     }
 }