Example #1
0
 private void Setup()
 {
     g = (Legacy.Game)Tag;
     lbShaders.DisplayMemberPath = "Text";
     pcsx2_ini = new Legacy.IniFile(Path.Combine(Legacy.UserSettings.ConfigDir, g.FileSafeTitle) + @"\PCSX2Bonus.ini");
     foreach (var newItem in Directory.GetFiles(Legacy.UserSettings.ShadersDir).Select(str => new ListViewItem {
         Content = Extensions.FileNameNoExt(str),
         Tag = str
     }))
     {
         lbShaders.Items.Add(newItem);
     }
 }
Example #2
0
        private void btnAddNew_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new OpenFileDialog {
                Filter = "Shader Files | *.fx"
            };

            if (dialog.ShowDialog() != true)
            {
                return;
            }
            var newItem = new ListViewItem {
                Content = Extensions.FileNameNoExt(dialog.FileName),
                Tag     = Path.Combine(Legacy.UserSettings.ShadersDir, Path.GetFileName(dialog.FileName))
            };

            lbShaders.Items.Add(newItem);
            try {
                File.Copy(dialog.FileName, Path.Combine(Legacy.UserSettings.ShadersDir, Path.GetFileName(dialog.FileName)), true);
            }
            catch {
            }
        }