示例#1
0
文件: MainForm.cs 项目: Cth1003/VRC
        private void PopulateFileList()
        {
            string[] FilePaths;
            try
            {
                FilePaths = Directory.GetFiles(textBox_RomDirectory.Text);
            }
            catch
            {
                return;
            }

            listView_Files.Items.Clear();
            listView_Files.Focus();
            if (FilePaths.Length > 0)
            {
                foreach (string FilePath in FilePaths)
                {
                    if (FilePath != textBox_SaveLocation.Text)
                    {
                        RomId id = new RomId(FilePath);
                        if (id.FileLength > 0)
                        {
                            listView_Files.Items.Add(id.GetListViewItem());
                        }
                    }
                }
                listView_Files.Items[0].Selected = true;
            }
            else
            {
                SelectedROM = null;
            }
        }
示例#2
0
文件: MainForm.cs 项目: Cth1003/VRC
 private void listView_Files_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (e.IsSelected)
     {
         SelectedROM = (RomId)e.Item.Tag;
         EnforceAutoEnd();
     }
 }