예제 #1
0
        private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            string fn = Path.Combine(Path.GetTempPath(), files[listView1.SelectedIndices[0]].name);

            File.WriteAllBytes(fn, Compress.ProcessBuffer(files[listView1.SelectedIndices[0]].file));
            DoDragDrop(new DataObject(DataFormats.FileDrop, new string[] { fn }), DragDropEffects.All);
        }
예제 #2
0
        private void listView1_ItemActivate(object sender, EventArgs e)
        {
            string fp = Path.Combine(Path.GetTempPath(), files[listView1.SelectedIndices[0]].name);

            File.WriteAllBytes(fp, Compress.ProcessBuffer(files[listView1.SelectedIndices[0]].file));
            System.Diagnostics.Process.Start(fp);
        }
예제 #3
0
        private void extractAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (SaveFileDialog a = new SaveFileDialog()
            {
                DefaultExt = "", Filter = "", FileName = "soundpack"
            })
            {
                if (filename != null)
                {
                    a.InitialDirectory = Path.GetDirectoryName(filename);
                    a.FileName         = Path.GetFileNameWithoutExtension(filename);
                }

                if (a.ShowDialog(this) == DialogResult.OK)
                {
                    Directory.CreateDirectory(a.FileName);
                }
                string dir = Path.Combine(Path.GetDirectoryName(a.FileName), Path.GetFileName(a.FileName));
                using (StreamWriter sw = File.CreateText(Path.Combine(dir, "index.txt")))
                {
                    List <FENTRY> list = new List <FENTRY>(files);
                    list.Sort((f1, f2) => StringComparer.OrdinalIgnoreCase.Compare(f1.name, f2.name));
                    foreach (FENTRY item in list)
                    {
                        Text = $"SADXsndSharp - Saving item " + list.IndexOf(item) + " of " + files.Count.ToString() + ", please wait...";
                        sw.WriteLine(item.name);
                        File.WriteAllBytes(Path.Combine(dir, item.name), Compress.ProcessBuffer(item.file));
                    }
                    sw.Flush();
                    sw.Close();
                }
                Text = "SADXsndSharp - " + Path.GetFileName(filename);
            }
        }
예제 #4
0
 private void extractToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (selectedItem == null)
     {
         return;
     }
     using (SaveFileDialog a = new SaveFileDialog()
     {
         DefaultExt = "wav",
         Filter = "WAV Files|*.wav|ADX Files|*.adx|All Files|*.*",
         FileName = selectedItem.Text
     })
         if (a.ShowDialog() == DialogResult.OK)
         {
             File.WriteAllBytes(a.FileName, Compress.ProcessBuffer(files[listView1.Items.IndexOf(selectedItem)].file));
         }
 }
예제 #5
0
 private void extractAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (FolderBrowserDialog a = new FolderBrowserDialog()
     {
         ShowNewFolderButton = true
     })
     {
         if (filename != null)
         {
             a.SelectedPath = Path.GetDirectoryName(filename);
         }
         if (a.ShowDialog(this) == DialogResult.OK)
         {
             using (StreamWriter sw = File.CreateText(Path.Combine(a.SelectedPath, "index.txt")))
             {
                 List <FENTRY> list = new List <FENTRY>(files);
                 list.Sort((f1, f2) => StringComparer.OrdinalIgnoreCase.Compare(f1.name, f2.name));
                 foreach (FENTRY item in list)
                 {
                     sw.WriteLine(item.name);
                     File.WriteAllBytes(Path.Combine(a.SelectedPath, item.name), Compress.ProcessBuffer(item.file));
                 }
                 sw.Flush();
                 sw.Close();
             }
         }
     }
 }