OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Program.cs
index 79b9a26..e702265 100644 (file)
@@ -10,11 +10,19 @@ namespace Handbrake
     using System.IO;\r
     using System.Windows.Forms;\r
 \r
+    using Caliburn.Castle;\r
+\r
+    using Castle.Core.Resource;\r
+    using Castle.Windsor;\r
+    using Castle.Windsor.Configuration.Interpreters;\r
+\r
     using HandBrake.ApplicationServices;\r
 \r
     using Handbrake.Presets;\r
     using Handbrake.Properties;\r
 \r
+    using Microsoft.Practices.ServiceLocation;\r
+\r
     /// <summary>\r
     /// HandBrake Starts Here\r
     /// </summary>\r
@@ -29,6 +37,9 @@ namespace Handbrake
         [STAThread]\r
         public static void Main(string[] args)\r
         {\r
+            WindsorContainer container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));\r
+            ServiceLocator.SetLocatorProvider(() => new WindsorAdapter(container));\r
+\r
             InstanceId = Process.GetProcessesByName("HandBrake").Length;\r
 \r
             // Handle any unhandled exceptions\r
@@ -39,6 +50,7 @@ namespace Handbrake
             {\r
                 Settings.Default.Upgrade();\r
                 Settings.Default.UpdateRequired = false;\r
+                Functions.Main.SetCliVersionData();\r
             }\r
 \r
             // Make sure we have any pre-requesits before trying to launch\r