private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) { if (!isPreferencesOpen()) { settingsForm settingsform = new settingsForm(); settingsform.Show(); } }
private void notification_MouseDoubleClick(object sender, MouseEventArgs e) { string deftray = Properties.Settings.Default.defaction; if (deftray == "Open history manager") { if (!isHistoryOpen()) { historyManagerForm historyform = new historyManagerForm(); historyform.Show(); // garbage collector System.GC.Collect(); System.GC.WaitForPendingFinalizers(); } } else if (deftray == "Open file upload") { try { this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); openFileDialog1.ShowDialog(); if (File.Exists(openFileDialog1.FileName)) { // copy file to save location File.Copy(openFileDialog1.FileName, ssfolder + "\\" + new FileInfo(openFileDialog1.FileName).Name, true); // process the screenshot string urlReturned = commonFunctions.useScreenshot(ssfolder + "\\" + new FileInfo(openFileDialog1.FileName).Name, ssfolder); // add link to history if returned if (urlReturned != "") { writeHistory(urlReturned); } } } catch (Exception exx) { // display alert fallyToast.Toaster alertformup2 = new fallyToast.Toaster(); alertformup2.Show("fallyGrab", "Error: " + exx.Message, -1, "Fade", "Up", "", "", "error"); commonFunctions.writeLog(exx.Message, exx.StackTrace); } } else if (deftray == "Open preferences") { if (!isPreferencesOpen()) { settingsForm settingsform = new settingsForm(); settingsform.Show(); } } else { string myPath = ssfolder; string windir = Environment.GetEnvironmentVariable("WINDIR"); System.Diagnostics.Process prc = new System.Diagnostics.Process(); prc.StartInfo.FileName = windir + @"\explorer.exe"; prc.StartInfo.Arguments = myPath + @"\"; prc.Start(); } }