Esempio n. 1
0
 private void btnBrowse_Click(object sender, RoutedEventArgs e)
 {
     FolderBrowserDialog dialog = new FolderBrowserDialog();
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         this.tbCardPath.Text = dialog.SelectedPath;
         this.lvMemCards.Items.Clear();
         foreach (string str in Directory.GetFiles(dialog.SelectedPath, "*.ps2"))
         {
             FileInfo info = new FileInfo(str);
             MemoryCard newItem = new MemoryCard {
                 Name = info.Name,
                 WriteTime = info.LastWriteTime.ToShortDateString(),
                 Size = Tools.GetSizeReadable2(info.Length)
             };
             this.lvMemCards.Items.Add(newItem);
         }
     }
 }
Esempio n. 2
0
 private void LoadInitialCard()
 {
     string path = this.pcsx2_ui.Read("Folders", "MemoryCards").Unescape();
     if (path == "memcards")
     {
         path = Path.Combine(Settings.Default.pcsx2DataDir, "memcards");
     }
     if (!Directory.Exists(path))
     {
         FolderBrowserDialog dialog = new FolderBrowserDialog {
             Description = "Select the directory containing the memory card files"
         };
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             base.Close();
             return;
         }
         this.tbCardPath.Text = dialog.SelectedPath;
     }
     else
     {
         this.tbCardPath.Text = path;
     }
     foreach (string str2 in Directory.GetFiles(this.tbCardPath.Text, "*.ps2"))
     {
         FileInfo info = new FileInfo(str2);
         MemoryCard newItem = new MemoryCard {
             Name = info.Name,
             WriteTime = info.LastWriteTime.ToShortDateString(),
             Size = Tools.GetSizeReadable2(info.Length)
         };
         this.lvMemCards.Items.Add(newItem);
     }
 }