Ejemplo n.º 1
0
        private void textBox_FileExtension_TextChanged(object sender, EventArgs e)
        {
            if (listBox_ArchiveFiles.SelectedIndex >= listBox_ArchiveFiles.Items.Count || listBox_ArchiveFiles.SelectedIndex < 0)
            {
                return;
            }
            IPACEntry entry = (IPACEntry)listBox_ArchiveFiles.Items[listBox_ArchiveFiles.SelectedIndex];

            entry.Extension = textBox_FileExtension.Text;
        }
Ejemplo n.º 2
0
        private void listBox_ArchiveFiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox_ArchiveFiles.SelectedIndex >= listBox_ArchiveFiles.Items.Count || listBox_ArchiveFiles.SelectedIndex < 0)
            {
                return;
            }
            IPACEntry entry = (IPACEntry)listBox_ArchiveFiles.Items[listBox_ArchiveFiles.SelectedIndex];

            textBox_FileName.Text      = entry.Filename;
            textBox_FileExtension.Text = entry.Extension;
        }
Ejemplo n.º 3
0
 private void listBox_ArchiveFiles_DragDrop(object sender, DragEventArgs e)
 {
     string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
     for (int i = 0; i < files.Length; i++)
     {
         string    file  = files[i];
         IPACEntry entry = new IPACEntry();
         entry.Extension = Path.GetExtension(file).Substring(1, 4).ToUpper();
         entry.Filename  = Path.GetFileNameWithoutExtension(file).ToUpper();
         using (FileStream stream = new FileStream(file, FileMode.Open))
         {
             entry.FileSize = (uint)stream.Length;
             entry.Buffer   = new byte[stream.Length];
             stream.Read(entry.Buffer, 0, entry.Buffer.Length);
         }
         listBox_ArchiveFiles.Items.Add(entry);
     }
 }