summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrake.ApplicationServices/Functions/Main.cs
blob: 43a064ca85406d47d8b926b18eef721e0ff80d07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*  Main.cs $
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.fr>.
    It may be used under the terms of the GNU General Public License. */

using HandBrake.ApplicationServices.Views;

namespace HandBrake.ApplicationServices.Functions
{
    using System.Diagnostics;

    /// <summary>
    /// Useful functions which various screens can use.
    /// </summary>
    public static class Main
    {
        /// <summary>
        /// Get the Process ID of HandBrakeCLI for the current instance.
        /// </summary>
        /// <returns>A list of processes</returns>
        public static Process[] GetCliProcess()
        {
            return Process.GetProcessesByName("HandBrakeCLI");
        }

        /// <summary>
        /// Show the Exception Window
        /// </summary>
        /// <param name="shortError">
        /// The short error.
        /// </param>
        /// <param name="longError">
        /// The long error.
        /// </param>
        public static void ShowExceptiowWindow(string shortError, string longError)
        {
            ExceptionWindow exceptionWindow = new ExceptionWindow();
            exceptionWindow.Setup(shortError, longError);
            exceptionWindow.Show();
        }
    }
}