Beispiel #1
0
 public void Fechar()
 {
     sceifile    = null;
     filename    = null;
     container   = null;
     listadeIECS = null;
     extrairToolStripMenuItem.Enabled     = false;
     importarVAGToolStripMenuItem.Enabled = false;
     extrairTudoToolStripMenuItem.Enabled = false;
     fecharToolStripMenuItem1.Enabled     = false;
     extrairuniccon.Enabled = false;
     listView1.Items.Clear();
     try
     {
         foreach (var form in Application.OpenForms)
         {
             try
             {
                 var opt = form as ListadeIECS;
                 opt.Close();
             }
             catch (Exception) { }
         }
     }
     catch (Exception) { }
     if (listView1.Visible)
     {
         ShowHide();
     }
 }
Beispiel #2
0
        void AbrirContainer(bool isDrag)
        {
            switch (isDrag)
            {
            case true:
                #region Verificar abertos
                if (sceifile != null | container != null)
                {
                    Fechar();
                }
                #endregion
                fecharToolStripMenuItem1.Enabled = true;
                #region Abrir arquivo
                container = new BINContainer(File.ReadAllBytes(filename));
                #endregion
                #region Adicionar na lista de IECS
                listadeIECS = new ListadeIECS(this);
                listadeIECS.Show();
                #endregion
                break;

            case false:
                var open = new OpenFileDialog();
                open.Filter = "Container Binário(*.bin)|*.bin|Todos os arquivos(*.*)|*.*";
                open.Title  = "Escolha um Container BIN para abrir";
                if (open.ShowDialog() == DialogResult.OK)
                {
                    #region Verificar abertos
                    if (sceifile != null | container != null)
                    {
                        Fechar();
                    }
                    #endregion
                    filename = open.FileName;
                    fecharToolStripMenuItem1.Enabled = true;
                    #region Abrir arquivo
                    container = new BINContainer(File.ReadAllBytes(filename));
                    #endregion
                    #region Adicionar na lista de IECS
                    listadeIECS = new ListadeIECS(this);
                    listadeIECS.Show();
                    #endregion
                }
                break;
            }
        }