private void ExecuteAsyncWithParams() { string workingFolder; if (string.IsNullOrEmpty(programName)) { return; } try { if (NativeMethods.FileExtensionIs(programName, ".exe")) { workingFolder = Path.GetDirectoryName(programName); FileExecutor.ProcessExecute(programName, dynamicParameters, workingFolder); } else { FileExecutor.Execute(programName, dynamicParameters); } } finally { dynamicParameters = string.Empty; programName = string.Empty; } }
public void Load() { string LauncherLocation; try { if (!string.IsNullOrEmpty(this.widgetEntry)) { LauncherLocation = Path.Combine(GlobalConfig.ApplicationFolder, "DLauncher.exe"); try { #if PORTABLE FileExecutor.ProcessExecute(LauncherLocation, "-p " + "\"" + widgetEntry + "\" -child", GlobalConfig.ApplicationFolder); #else FileExecutor.ProcessExecute(LauncherLocation, "\"" + widgetEntry + "\" -child", GlobalConfig.ApplicationFolder); #endif } catch { //it's not a critical problem } } } catch { } }
/// <summary> /// Execute the file (application or folder). This method is used by Run method /// </summary> private void ExecuteAsync() { string workingFolder; if (string.IsNullOrEmpty(programName)) { return; } try { if (FileOperations.FileIsExe(programName)) { workingFolder = Path.GetDirectoryName(programName); FileExecutor.ProcessExecute(programName, targetParameters, workingFolder); } else { FileExecutor.Execute(programName, targetParameters); } } finally { programName = string.Empty; } }
private void btnOpenData_Click(object sender, EventArgs e) { #if PORTABLE FileExecutor.Execute(GlobalConfig.MainFolder); #else FileExecutor.Execute(GlobalConfig.UserSpecificDataFolder); #endif }
private void btnBackup_Click(object sender, EventArgs e) { string ZipFileToCreate = GlobalConfig.BackupFileName; this.Cursor = Cursors.WaitCursor; FileOperations.CreateBackup(ZipFileToCreate); this.Cursor = Cursors.Default; FileExecutor.Execute(GlobalConfig.BackupFolder); }
private void ExecuteAsync() { try { if (string.IsNullOrEmpty(programName)) { FileExecutor.Execute(path, args); } else { FileExecutor.Execute(programName); } } finally { programName = string.Empty; } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openFD = new OpenFileDialog(); if (openFD.ShowDialog() == DialogResult.OK) { Logic.FileExecutor file = new FileExecutor(openFD.FileName); var data = file.ReadFile(); model = new DrawingObject(data); if (data.VT.Length != 0) { openTextureToolStripMenuItem.Enabled = true; } if (data.VN.Length != 0) { gouraudShadingToolStripMenuItem.Enabled = true; } label1.Text = "file loaded, " + data.Vertices.Length + " V, " + data.VT.Length + " VT, " + data.VN.Length + " VN, " + data.Faces.Length + " Faces"; runToolStripMenuItem.Enabled = settingsToolStripMenuItem.Enabled = true; } Clear(); }
private void btnOpenCache_Click(object sender, EventArgs e) { FileExecutor.Execute(GlobalConfig.RollingStonesCache); }
private void btnOpenSkins_Click(object sender, EventArgs e) { FileExecutor.Execute(GlobalConfig.SkinsFolder); }
private static void ExecuteAsync() { FileExecutor.Execute(Path.Combine(Environment.SystemDirectory, "rundll32.exe"), "/d \"" + Environment.SystemDirectory + "\\shell32.dll\",Control_RunDLL timedate.cpl"); }