void ArtpathFD_Click(object sender, EventArgs e)
 {
     using (var f = new VistaOpenFileDialog())
     {
         f.FileName = ArtPath;
         f.Filter = "Rocksmith DDS Art Files (*.dds)|*.dds";
         if (f.ShowDialog() == DialogResult.OK)
         {
             ArtPathCTB.Text = ArtPath = f.FileName;
         }
     }
 }
 void btnShowLights_Click(object sender, EventArgs e)
 {
     using (var f = new VistaOpenFileDialog())
     {
         f.FileName = ShowLightsPath;
         f.Filter = "Rocksmith 2014 ShowLight XML Files (*_showlights.xml)|*_showlights.xml";
         if (f.ShowDialog() == DialogResult.OK)
         {
             txtShowLights.Text = ShowLightsPath = f.FileName;
         }
     }
 }
 void SngpathFD_Click(object sender, EventArgs e)
 {
     using (var f = new VistaOpenFileDialog())
     {
         f.FileName = SngPath;
         f.Filter = "Rocksmith Song Files (*.sng)|*.sng";
         if (f.ShowDialog() == DialogResult.OK)
         {
             SngPathCTB.Text = ArtPath = f.FileName;
             isCustomCB.Checked = IsCustom = true; //possible jvocals and regular vocals, but supported only one custom font texture
         }
     }
 }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            string path = Convert.ToString(value);

            using (var dialog = new VistaOpenFileDialog())
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    path = dialog.FileName;
                }
            }
            return new PathToFile
                {
                    AbsolutePath = path
                } ;
        }
        private void rampUpBT_Click(object sender, EventArgs e)
        {
            using (var ofd = new VistaOpenFileDialog())
            {
                ofd.Filter = "DDC Ramp-Up model (*.xml)|*.xml";
                ofd.CheckFileExists = true;
                ofd.CheckPathExists = true;
                ofd.Multiselect = true;
                ofd.ReadOnlyChecked = true;
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog() != DialogResult.OK)
                    return;

                foreach (var file in ofd.FileNames)
                {
                    var name = Path.GetFileNameWithoutExtension(file);
                    Directory.CreateDirectory(@".\ddc\umdls\");
                    var path = String.Format(@".\ddc\umdls\user_{0}.xml", name);
                    if (!ramUpMdlsCbox.Items.Contains(name))
                    {
                        try { File.Copy(file, path, true); }
                        catch { }
                        ramUpMdlsCbox.Items.Add(name);
                    }
                    ramUpMdlsCbox.SelectedIndex = ramUpMdlsCbox.FindStringExact(name);
                }
            }
        }
        private void AddArrBT_Click(object sender, EventArgs e)
        {
            using (var ofd = new VistaOpenFileDialog())
            using (var sfd = new VistaFolderBrowserDialog())
            {
                ofd.Filter = "Select Package or Arrangement (*.psarc;*.dat;*.edat;*.xml)|*.psarc;*.dat;*.edat;*.xml|" + "All files|*.*";
                ofd.FilterIndex = 0;
                ofd.Multiselect = true;
                ofd.ReadOnlyChecked = true;
                ofd.CheckFileExists = true;
                ofd.CheckPathExists = true;
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog() != DialogResult.OK)
                    return;

                foreach (var file in ofd.FileNames)
                {
                    if (file.EndsWith("_showlights.xml") ||
                        file.EndsWith(".dlc.xml") ||
                        file.StartsWith("DDC_"))
                        continue;

                    if (!DLCdb.ContainsValue(file))
                        DLCdb.Add(Path.GetFileNameWithoutExtension(file), file);
                }
            }

            FillDB();
        }
        private void btnConfigFile_Click(object sender, EventArgs e)
        {
            using (var ofd = new VistaOpenFileDialog())
            {
                ofd.Filter = "DDC Config file (*.cfg)|*.cfg";
                ofd.CheckFileExists = true;
                ofd.CheckPathExists = true;
                ofd.Multiselect = true;
                ofd.ReadOnlyChecked = true;
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog() != DialogResult.OK)
                    return;

                string[] filePaths = ofd.FileNames;

                foreach (var filePath in filePaths)
                {
                    var fileName = Path.GetFileNameWithoutExtension(filePath);
                    Directory.CreateDirectory(@".\ddc\ucfg\");
                    var path = String.Format(@".\ddc\ucfg\user_{0}.cfg", fileName);
                    if (!cmbConfigFile.Items.Contains(fileName))
                    {
                        try { File.Copy(filePath, path, true); }
                        catch { }
                        cmbConfigFile.Items.Add(fileName);
                    }
                    cmbConfigFile.SelectedIndex = cmbConfigFile.FindStringExact(fileName);
                }
            }
        }