/* * Starts a new explorer process with passed arguments. * * Added 2007-05-01 by T.Norad * 2009-02-27 Nochbaer: Edited to select the file in the explorer window and call the standard shell on mono */ public static void startExplorerProcess(String path, String filename) { if (!UtilitiesForMono.IsRunningOnMono) { string arguments; if (filename.Length > 0) { string secondStringArgument = ""; if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) { secondStringArgument = System.IO.Path.DirectorySeparatorChar.ToString(); } arguments = String.Format("/e,/select,\"{0}{1}{2}\"", path, secondStringArgument, filename); } else { arguments = String.Format("/e,{0}", path); } ProcessStarter.startProcess(EXLORER_PROCESS, arguments); } else { if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) { path = path + System.IO.Path.DirectorySeparatorChar.ToString(); ProcessStarter.startProcess(path); } } }
private void MainForm_Shown(object sender, EventArgs e) { if (!bool.Parse(m_Settings["FirstStart"])) { switch (m_Settings["MainFormWindowState"]) { case "Normal": Location = new Point(int.Parse(m_Settings["MainFormLocationX"]), int.Parse(m_Settings["MainFormLocationY"])); Size = new Size(int.Parse(m_Settings["MainFormSizeWidth"]), int.Parse(m_Settings["MainFormSizeHeight"])); break; case "Maximized": WindowState = FormWindowState.Maximized; break; case "Minimized": WindowState = FormWindowState.Minimized; break; } } if (bool.Parse(m_Settings["ShowMessageBoxes"]) && Core.IsUpdateAvailable) { if (MessageBox.Show(this, Properties.Resources.NewVersionMessage.Replace(@"\n", "\n"), String.Format(Constants.Software, Core.Version), MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { ProcessStarter.startProcess(Properties.Resources.NewVersionDownloadLink); } } if (bool.Parse(m_Settings["HasDownloadLimit"])) { DownstreamImage = Properties.Resources.downstream_limited_16x16; } else { DownstreamImage = Properties.Resources.downstream_16x16; } if (bool.Parse(m_Settings["HasUploadLimit"])) { UpstreamImage = Properties.Resources.upstream_limited_16x16; } else { UpstreamImage = Properties.Resources.upstream_16x16; } }
private void openFileToolStripMenuItem_Click(object sender, EventArgs e) { //2008-09-09 Nochbaer: catch error when file is not associated with a program try { SharedFile sharedFile; for (int n = 0; n < sharedFilesDataGridView.SelectedRows.Count; n++) { if (Core.SharedFiles.TryGetValue(((RandomTag <string>)sharedFilesDataGridView.SelectedRows[n].Tag).Tag, out sharedFile)) { // process call moved to new class ProcessStarter // Added 2007-05-01 by T.Norad ProcessStarter.startProcess(sharedFile.FilePath); } } } catch { } }
/* * Starts a new system process without arguments. * * Added 2007-05-01 by T.Norad */ public static void startProcess(String uri) { ProcessStarter.startProcess(uri, null); }
/* * Starts a new sysdie process in the passed startFolder. * * Added 2007-05-01 by T.Norad */ public static void startSyndieProcess(String startFolder) { ProcessStarter.startProcess(startFolder + SYNDIE_PROCESS); }
//2008-08-14 Nochbaer BZ 46 private void portTestButton_Click(object sender, EventArgs e) { ProcessStarter.startProcess(Properties.Resources.PortTestUrl + portNumericUpDown.Value.ToString()); }