private void MenuSaveAs_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "동방비상천 데이터 파일(*.dat)|*.dat|모든 파일(*.*)|*.*"; sfd.FilterIndex = 1; sfd.OverwritePrompt = true; if (sfd.ShowDialog() == DialogResult.OK) { StartOpenSave(); m_save_progress = new frmSaveProgress(); Thread th = new Thread(new ParameterizedThreadStart(SaveWork)); th.Start(sfd.FileName); m_save_progress.ShowDialog(); th.Abort(); if (MenuOpen.Enabled == false) { FinalizeOpenSave(false); File.Delete(sfd.FileName); } else { m_workingpath = sfd.FileName; Reload(); } } }
private void MenuSave_Click(object sender, EventArgs e) { StartOpenSave(); m_save_progress = new frmSaveProgress(); Thread th = new Thread(new ParameterizedThreadStart(SaveWork)); string temp_name = Path.GetTempFileName(); th.Start(temp_name); m_save_progress.ShowDialog(); th.Abort(); if (MenuOpen.Enabled == false) { FinalizeOpenSave(true); File.Delete(temp_name); } else { File.Delete(m_workingpath); File.Move(temp_name, m_workingpath); Reload(); } }