private void loadSettingsFromFileToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("By loading settings from a file, all of your current settings will be erased. Do you want to continue?", "Load Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) != DialogResult.No) { try { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Palantir Setting Files (*.pln)|*.pln|All files (*.*)|*.*"; ofd.ShowDialog(); if (ofd.FileName != "") { frmEnterPassword insFrmEnterPassword = new frmEnterPassword(); insFrmEnterPassword.ShowDialog(); LoadSettings(insFrmEnterPassword.password, ofd.FileName); LoadConnectToMenuItems(); LoadConnectViaConsoleRemoteDesktops(); MessageBox.Show("Remote desktop connections have been successfully imported."); } } catch (Exception) { MessageBox.Show("The password you have entered is incorrect."); return; } } }
private void saveSettingsToAFToolStripMenuItem_Click(object sender, EventArgs e) { frmEnterPassword insFrmEnterPassword = new frmEnterPassword(); insFrmEnterPassword.ShowDialog(); SaveSettings(insFrmEnterPassword.password); }