Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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
            {
            }
        }
Exemplo n.º 3
0
        /// <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;
            }
        }
Exemplo n.º 4
0
        private void btnOpenData_Click(object sender, EventArgs e)
        {
#if PORTABLE
            FileExecutor.Execute(GlobalConfig.MainFolder);
#else
            FileExecutor.Execute(GlobalConfig.UserSpecificDataFolder);
#endif
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 private void ExecuteAsync()
 {
     try
     {
         if (string.IsNullOrEmpty(programName))
         {
             FileExecutor.Execute(path, args);
         }
         else
         {
             FileExecutor.Execute(programName);
         }
     }
     finally
     {
         programName = string.Empty;
     }
 }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
 private void btnOpenCache_Click(object sender, EventArgs e)
 {
     FileExecutor.Execute(GlobalConfig.RollingStonesCache);
 }
Exemplo n.º 9
0
 private void btnOpenSkins_Click(object sender, EventArgs e)
 {
     FileExecutor.Execute(GlobalConfig.SkinsFolder);
 }
Exemplo n.º 10
0
 private static void ExecuteAsync()
 {
     FileExecutor.Execute(Path.Combine(Environment.SystemDirectory, "rundll32.exe"),
                          "/d \"" + Environment.SystemDirectory + "\\shell32.dll\",Control_RunDLL timedate.cpl");
 }