/// <summary> /// Initiates an open file dialog. /// </summary> public void Open() { OpenFileDialog openFile = new OpenFileDialog() { Filter = "7 Days to Die save file(*.ttp)|*.ttp|All Files(*.*)|*.*", Multiselect = true, CheckFileExists = true }; openFile.FileOk += (sender, e) => { bottomStatusBar.SetText("Opening..."); foreach (string fileName in openFile.FileNames) { try { OpenFile(fileName, new PlayerDataFile(fileName), 0); } catch (Exception ex) { frmErrorReport frm = new frmErrorReport(string.Format("Failed to open file {0}.", fileName.Substring(fileName.LastIndexOf('\\') + 1)), ex, fileName); frm.ShowDialog(); } } bottomStatusBar.Reset(); }; openFile.ShowDialog(); }
/// <summary> /// Event handler for save error report button. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void sendReportClick(object sender, EventArgs e) { string path = ""; if (playerTabs.GetTabCount() > 0) { path = playerTabs.GetSelectedTab().path; } frmErrorReport frm = new frmErrorReport("Send Report?", null, path); }