OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / HandBrake.ApplicationServices / Init.cs
1 /*  Init.cs $\r
2     This file is part of the HandBrake source code.\r
3     Homepage: <http://handbrake.fr>.\r
4     It may be used under the terms of the GNU General Public License. */\r
5 \r
6 namespace HandBrake.ApplicationServices\r
7 {\r
8     using System;\r
9     using System.Reflection;\r
10 \r
11     /// <summary>\r
12     /// Initialize ApplicationServices\r
13     /// </summary>\r
14     public class Init\r
15     {\r
16         /// <summary>\r
17         /// Setup the Settings used by the applicaiton with this library\r
18         /// </summary>\r
19         /// <param name="versionString">\r
20         /// The version / name of the application that's using this DLL.\r
21         /// </param>\r
22         /// <param name="instanceId">\r
23         /// The Instance ID\r
24         /// </param>\r
25         /// <param name="completionOption">\r
26         /// The completion option.\r
27         /// </param>\r
28         /// <param name="disableDvdNav">\r
29         /// The disable dvd nav.\r
30         /// </param>\r
31         /// <param name="growlEncode">\r
32         /// The growl encode.\r
33         /// </param>\r
34         /// <param name="growlQueue">\r
35         /// The growl queue.\r
36         /// </param>\r
37         /// <param name="processPriority">\r
38         /// The process priority.\r
39         /// </param>\r
40         /// <param name="saveLogPath">\r
41         /// The save log path.\r
42         /// </param>\r
43         /// <param name="saveLogToSpecifiedPath">\r
44         /// The save log to specified path.\r
45         /// </param>\r
46         /// <param name="saveLogWithVideo">\r
47         /// The save log with video.\r
48         /// </param>\r
49         /// <param name="showCliForInGuiEncodeStatus">\r
50         /// The show cli for in gui encode status.\r
51         /// </param>\r
52         /// <param name="preventSleep">\r
53         /// Prevent the system from sleeping\r
54         /// </param>\r
55         public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,\r
56                                   bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,\r
57                                   bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)\r
58         {\r
59             InstanceId = instanceId;\r
60             HandBrakeGuiVersionString = versionString;\r
61             Properties.Settings.Default.CompletionOption = completionOption;\r
62             Properties.Settings.Default.disableDvdNav = disableDvdNav;\r
63             Properties.Settings.Default.growlEncode = growlEncode;\r
64             Properties.Settings.Default.growlQueue = growlQueue;\r
65             Properties.Settings.Default.processPriority = processPriority;\r
66             Properties.Settings.Default.saveLogPath = saveLogPath;\r
67             Properties.Settings.Default.saveLogToSpecifiedPath = saveLogToSpecifiedPath;\r
68             Properties.Settings.Default.saveLogWithVideo = saveLogWithVideo;\r
69             Properties.Settings.Default.showCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;\r
70             Properties.Settings.Default.preventSleep = preventSleep;\r
71 \r
72             Properties.Settings.Default.Save();\r
73         }\r
74 \r
75         /// <summary>\r
76         /// Gets the Assembly version.\r
77         /// </summary>\r
78         /// <returns>\r
79         /// Version data\r
80         /// </returns>\r
81         public static Version AssemblyVersion()\r
82         {\r
83             return Assembly.GetExecutingAssembly().GetName().Version;\r
84         }\r
85 \r
86         /// <summary>\r
87         /// The instance ID used by the Main Applicaiton\r
88         /// </summary>\r
89         public static int InstanceId;\r
90 \r
91         /// <summary>\r
92         /// The Applicaiton that uses this DLL can pass in it's version string.\r
93         /// </summary>\r
94         public static string HandBrakeGuiVersionString;\r
95     }\r
96 }\r