private void frmMain_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode.ToString().Equals("F")) { //Console.WriteLine("Search"); Form frmSearch = new frmSearch(this.listResults); frmSearch.Visible = true; } else if (e.Control && e.KeyCode.ToString().Equals("Z")) { if(MessageBox.Show("Are you sure you want to erase your configuration?","Are you sure?",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){ Properties.Settings.Default.EditorPath = ""; Properties.Settings.Default.EditorCommandLine = ""; Properties.Settings.Default.ExtensionsLimit = false; Properties.Settings.Default.Extensions = null; Properties.Settings.Default.LastPathSelected = ""; Properties.Settings.Default.Comments = false; Properties.Settings.Default.CaseSensitive = false; Properties.Settings.Default.TestFilenames = false; Properties.Settings.Default.Save(); } } else if (e.Control && e.KeyCode.ToString().Equals("D")) { string strOut = "Ed Path :" + Properties.Settings.Default.EditorPath + Environment.NewLine + "Ed CL :" + Properties.Settings.Default.EditorCommandLine + Environment.NewLine + "Ext Lim :" + Properties.Settings.Default.ExtensionsLimit.ToString() + Environment.NewLine + "Exts :" + Properties.Settings.Default.Extensions.ToString() + Environment.NewLine + "LastPath:" + Properties.Settings.Default.LastPathSelected + "Case :" + Properties.Settings.Default.CaseSensitive + "Test FNa:" + Properties.Settings.Default.TestFilenames + "Comments:" + Properties.Settings.Default.Comments; MessageBox.Show(strOut, "Current config", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (e.Control && e.KeyCode.ToString().Equals("P")) { StringBuilder strOut = new StringBuilder(); if (profileLines == null) return; foreach (string strLine in profileLines) { if (strOut.Length == 0) { strOut.Append(strLine); } else { strOut.Append("\n"); strOut.Append(strLine); } } MessageBox.Show(strOut.ToString(), "Current config", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void frmMain_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode.ToString().Equals("F")) { //Console.WriteLine("Search"); Form frmSearch = new frmSearch(this.listResults); frmSearch.Visible = true; } else if (e.Control && e.KeyCode.ToString().Equals("Z")) { if (MessageBox.Show("Are you sure you want to erase your configuration?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Properties.Settings.Default.EditorPath = ""; Properties.Settings.Default.EditorCommandLine = ""; Properties.Settings.Default.ExtensionsLimit = false; Properties.Settings.Default.Extensions = null; Properties.Settings.Default.LastPathSelected = ""; Properties.Settings.Default.Comments = false; Properties.Settings.Default.CaseSensitive = false; Properties.Settings.Default.TestFilenames = false; Properties.Settings.Default.Save(); } } else if (e.Control && e.KeyCode.ToString().Equals("D")) { string strOut = "Ed Path :" + Properties.Settings.Default.EditorPath + Environment.NewLine + "Ed CL :" + Properties.Settings.Default.EditorCommandLine + Environment.NewLine + "Ext Lim :" + Properties.Settings.Default.ExtensionsLimit.ToString() + Environment.NewLine + "Exts :" + Properties.Settings.Default.Extensions.ToString() + Environment.NewLine + "LastPath:" + Properties.Settings.Default.LastPathSelected + "Case :" + Properties.Settings.Default.CaseSensitive + "Test FNa:" + Properties.Settings.Default.TestFilenames + "Comments:" + Properties.Settings.Default.Comments; MessageBox.Show(strOut, "Current config", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (e.Control && e.KeyCode.ToString().Equals("P")) { StringBuilder strOut = new StringBuilder(); if (profileLines == null) { return; } foreach (string strLine in profileLines) { if (strOut.Length == 0) { strOut.Append(strLine); } else { strOut.Append("\n"); strOut.Append(strLine); } } MessageBox.Show(strOut.ToString(), "Current config", MessageBoxButtons.OK, MessageBoxIcon.Information); } }