private void btnProjectRestoreZw1_Click(object sender, EventArgs e) { if (!ValidateProjectSelected(this.txtProjectRestoreZw1)) { return; } try { using (Restore restoreZw1 = new Restore()) { StringCollection targetZw1Path = new StringCollection(); targetZw1Path.Add(this.txtProjectRestoreZw1.Text); string restorePath = string.Format("{0}\\EPLANApiExt", Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); string restoredProjectName = string.Format("{0}_{1}", Path.GetFileNameWithoutExtension(this.txtProjectRestoreZw1.Text), DateTime.Now.ToString("yyMMdd.HHmmssfff")); restoreZw1.Project(targetZw1Path, restorePath, restoredProjectName, false, false); this.txtProjectOpenElk.Text = string.Format("{0}.elk", Path.Combine(restorePath, restoredProjectName)); MessageDisplayHelper.Show("Project Restore Completed!", "::: Restore Project"); } } catch (Exception ex) { MessageDisplayHelper.Show(string.Format("Project Restore Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Restore Project", EnumDecisionIcon.eEXCLAMATION); } }
public void RestoreProject(string zw1FullPath, string elkFullPath) { try { Restore restoreZw1 = new Restore(); StringCollection targetZw1Path = new StringCollection(); targetZw1Path.Add(zw1FullPath); string restorePath = Path.GetDirectoryName(elkFullPath); string restoredProjectName = Path.GetFileNameWithoutExtension(elkFullPath); restoreZw1.Project(targetZw1Path, restorePath, restoredProjectName, false, false); MessageBox.Show("프로젝트가 성공적으로 복구되었습니다.", "Restore 성공", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Restore 에러", MessageBoxButtons.OK, MessageBoxIcon.Error); throw ex; } }