public static void Run(CustomCommandInfo info)
 {
     if (string.IsNullOrEmpty(info.Arguments))
     {
         Process.Start(info.FilePath);
     }
     else
     {
         Process.Start(info.FilePath, info.Arguments);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Method to execute a <see cref="CustomCommandInfo"/>.
        /// </summary>
        /// <param name="info"><see cref="CustomCommandInfo"/> which is executed.</param>
        public static void Run(CustomCommandInfo info)
        {
            var processStartInfo = new ProcessStartInfo()
            {
                FileName        = info.FilePath,
                UseShellExecute = true
            };

            if (!string.IsNullOrEmpty(info.Arguments))
            {
                processStartInfo.Arguments = info.Arguments;
            }

            Process.Start(processStartInfo);
        }
Beispiel #3
0
 public static void Run(CustomCommandInfo info)
 {
     try
     {
         if (string.IsNullOrEmpty(info.Arguments))
         {
             Process.Start(info.FilePath);
         }
         else
         {
             Process.Start(info.FilePath, info.Arguments);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error in Utilities.CustomCommand.Run()", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }