private void btnCreateFromFolder_Click(object sender, EventArgs e) { FolderBrowserDialog dFolder = new FolderBrowserDialog(); DialogResult dFolderResult = dFolder.ShowDialog(); if (dFolderResult == DialogResult.OK) { SaveFileDialog dFile = new SaveFileDialog(); dFile.Filter = "PAK files (*.pak)|*.pak"; DialogResult dFileResult = dFile.ShowDialog(); if (dFileResult == DialogResult.OK) { frmCreating.Create(); var frmTemp = new frmCreating(); using (Pack pak = new Pack(dFile.FileName)) pak.InsertFolder(dFolder.SelectedPath); frmCreating.Destroy(); pakfile = new string[1] { dFile.FileName }; treeView1.Nodes.Clear(); loadPakTree(); } } }
public static void Create() { var t = new Thread(() => { mInstance = new frmCreating(); mInstance.FormClosed += (s, e) => mInstance = null; Application.Run(mInstance); }); t.SetApartmentState(ApartmentState.STA); t.IsBackground = true; t.Start(); }