<ErrorReport>prompt</ErrorReport>\r
</PropertyGroup>\r
<ItemGroup>\r
+ <Reference Include="Castle.Core, Version=1.2.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
+ <Reference Include="Castle.MicroKernel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
+ <Reference Include="Castle.Windsor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
<Reference Include="Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=MSIL">\r
<SpecificVersion>False</SpecificVersion>\r
<HintPath>..\libraries\Growl.Connector.dll</HintPath>\r
<Compile Include="Services\Interfaces\IScan.cs" />\r
<Compile Include="Services\Queue.cs" />\r
<Compile Include="Services\Scan.cs" />\r
+ <Compile Include="WindsorInstaller.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="app.config" />\r
--- /dev/null
+/* WindsorInstaller.cs $\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices\r
+{\r
+ using Castle.MicroKernel;\r
+ using Castle.Windsor;\r
+\r
+ using HandBrake.ApplicationServices.Services;\r
+ using HandBrake.ApplicationServices.Services.Interfaces;\r
+\r
+ /// <summary>\r
+ /// This is the Windsor Installer class.\r
+ /// </summary>\r
+ public class WindsorInstaller : IWindsorInstaller\r
+ {\r
+ /// <summary>\r
+ /// Setup the Services for this Library\r
+ /// </summary>\r
+ /// <param name="container">\r
+ /// The container.\r
+ /// </param>\r
+ /// <param name="store">\r
+ /// The store.\r
+ /// </param>\r
+ public void Install(IWindsorContainer container, IConfigurationStore store)\r
+ {\r
+ container.AddComponent<IScan, ScanService>();\r
+ container.AddComponent<IQueue, Queue>();\r
+ container.AddComponent<IEncode, Encode>();\r
+ }\r
+ }\r
+}\r
<ErrorReport>prompt</ErrorReport>\r
</PropertyGroup>\r
<ItemGroup>\r
+ <Reference Include="Castle.Core, Version=1.2.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
+ <Reference Include="Castle.MicroKernel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
+ <Reference Include="Castle.Windsor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />\r
<Reference Include="System" />\r
<Reference Include="System.Core" />\r
<Reference Include="System.Drawing" />\r
<Compile Include="Views\UpdateInfo.Designer.cs">\r
<DependentUpon>UpdateInfo.cs</DependentUpon>\r
</Compile>\r
+ <Compile Include="WindsorInstaller.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<EmbeddedResource Include="Properties\Resources.resx">\r
--- /dev/null
+/* WindsorInstaller.cs $\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.Framework\r
+{\r
+ using Castle.MicroKernel;\r
+ using Castle.Windsor;\r
+\r
+ using HandBrake.Framework.Services;\r
+ using HandBrake.Framework.Services.Interfaces;\r
+\r
+ /// <summary>\r
+ /// This is the Windsor Installer class.\r
+ /// </summary>\r
+ public class WindsorInstaller : IWindsorInstaller\r
+ {\r
+ /// <summary>\r
+ /// Setup the Services for this Library\r
+ /// </summary>\r
+ /// <param name="container">\r
+ /// The container.\r
+ /// </param>\r
+ /// <param name="store">\r
+ /// The store.\r
+ /// </param>\r
+ public void Install(IWindsorContainer container, IConfigurationStore store)\r
+ {\r
+ container.AddComponent<IErrorService, ErrorService>();\r
+ }\r
+ }\r
+}\r
using System;\r
using System.Diagnostics;\r
using System.IO;\r
+ using System.Reflection;\r
using System.Windows.Forms;\r
\r
using Caliburn.Castle;\r
\r
- using Castle.Core.Resource;\r
+ using Castle.MicroKernel;\r
using Castle.Windsor;\r
- using Castle.Windsor.Configuration.Interpreters;\r
\r
using HandBrake.ApplicationServices;\r
+ using HandBrake.Framework.Services;\r
+ using HandBrake.Framework.Services.Interfaces;\r
\r
using Handbrake.Presets;\r
using Handbrake.Properties;\r
[STAThread]\r
public static void Main(string[] args)\r
{\r
- WindsorContainer container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));\r
+ // WindsorContainer container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));\r
+ WindsorContainer container = new WindsorContainer();\r
+ // TODO Would be nice to find a way to do this automatically without having to reference the libraries specifically.\r
+ container.Install(new HandBrake.Framework.WindsorInstaller());\r
+ container.Install(new HandBrake.ApplicationServices.WindsorInstaller());\r
+\r
ServiceLocator.SetLocatorProvider(() => new WindsorAdapter(container));\r
\r
InstanceId = Process.GetProcessesByName("HandBrake").Length;\r
\r
<startup />\r
\r
- <castle>\r
+ <!--<castle>\r
<components>\r
<component id="IErrorService"\r
service="HandBrake.Framework.Services.Interfaces.IErrorService, HandBrake.Framework"\r
type="HandBrake.Framework.Services.ErrorService, HandBrake.Framework"/>\r
</components>\r
- </castle>\r
+ </castle>-->\r
\r
</configuration>
\ No newline at end of file