//Play private void PlayRom(object sender, MouseEventArgs e) { if (listView1.SelectedItems.Count != 1) { return; } ListViewItem_Rom IT = (ListViewItem_Rom)listView1.SelectedItems[0]; if (File.Exists(IT.RomPath)) { if (ShouldSaveFolders) { SaveFolders(); ShouldSaveFolders = false; } _TheMainForm.OpenRom(IT.RomPath); _TheMainForm.Select(); SaveSettings(); } }
void LoadFilesFromCache() { listView1.Items.Clear(); foreach (MFile Fil in _SelectedFolder.Folder.Files) { ListViewItem_Rom IT = new ListViewItem_Rom(); IT.RomPath = Fil.Path; if (Path.GetExtension(Fil.Path).ToLower() == ".nes") { IT.ImageIndex = 2; } else { IT.ImageIndex = 3; } IT.Text = Fil.Name; IT.SubItems.Add(Fil.Size); IT.SubItems.Add(Fil.Mapper); switch (_SelectedFolder.Folder.Filter) { case FolderFilter.All: listView1.Items.Add(IT); break; case FolderFilter.SupportedMappersOnly: if (Fil.SupportedMapper) { listView1.Items.Add(IT); } break; case FolderFilter.Mapper: if (Fil.Mapper == TextBox1_mapper.Text & Path.GetExtension(Fil.Path).ToLower() == ".nes") { listView1.Items.Add(IT); } break; } } label1_status.Text = listView1.Items.Count + " items found."; }