</Reference>\r
<Reference Include="PresentationFramework" />\r
<Reference Include="System" />\r
- <Reference Include="System.ComponentModel.Composition" />\r
<Reference Include="System.Drawing" />\r
<Reference Include="System.Management" />\r
<Reference Include="System.Runtime.Serialization" />\r
<Compile Include="Services\Interfaces\IUpdateVersionService.cs" />\r
<Compile Include="Services\UpdateVersionService.cs" />\r
<Compile Include="Startup\CastleBootstrapper.cs" />\r
- <Compile Include="Startup\MefBootstrapper.cs" />\r
<Compile Include="UserSettingConstants.cs" />\r
<Compile Include="ViewModels\AboutViewModel.cs" />\r
<Compile Include="ViewModels\AddPresetViewModel.cs" />\r
+++ /dev/null
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="MefBootstrapper.cs" company="HandBrake Project (http://handbrake.fr)">\r
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-// The MEF Bootstrapper (Not Used)\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.Startup \r
-{\r
- using System;\r
- using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
- using System.ComponentModel.Composition.Hosting;\r
- using System.Linq;\r
-\r
- using Caliburn.Micro;\r
-\r
- using HandBrakeWPF.ViewModels.Interfaces;\r
-\r
- /// <summary>\r
- /// The MEF Bootstrapper (Not Used)\r
- /// </summary>\r
- public class MefBootstrapper : Bootstrapper<IMainViewModel>\r
- {\r
- /// <summary>\r
- /// The Backing field for the container\r
- /// </summary>\r
- private CompositionContainer container;\r
-\r
- /// <summary>\r
- /// MEF Configure\r
- /// </summary>\r
- protected override void Configure()\r
- {\r
- container = new CompositionContainer(\r
- new AggregateCatalog(AssemblySource.Instance.Select(x => new AssemblyCatalog(x)))\r
- );\r
-\r
- var batch = new CompositionBatch();\r
-\r
- batch.AddExportedValue<IWindowManager>(new WindowManager());\r
- batch.AddExportedValue<IEventAggregator>(new EventAggregator());\r
- batch.AddExportedValue(container);\r
-\r
- container.Compose(batch);\r
- }\r
-\r
- /// <summary>\r
- /// Get an Instance of a service\r
- /// </summary>\r
- /// <param name="serviceType">\r
- /// The service.\r
- /// </param>\r
- /// <param name="key">\r
- /// The key.\r
- /// </param>\r
- /// <returns>\r
- /// The Service Requested\r
- /// </returns>\r
- protected override object GetInstance(Type serviceType, string key)\r
- {\r
- string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;\r
- var exports = container.GetExportedValues<object>(contract);\r
-\r
- if (exports.Count() > 0)\r
- return exports.First();\r
-\r
- throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));\r
- }\r
-\r
- /// <summary>\r
- /// Get all instances of a service\r
- /// </summary>\r
- /// <param name="serviceType">\r
- /// The service.\r
- /// </param>\r
- /// <returns>\r
- /// A collection of instances of the requested service type.\r
- /// </returns>\r
- protected override IEnumerable<object> GetAllInstances(Type serviceType)\r
- {\r
- return container.GetExportedValues<object>(AttributedModelServices.GetContractName(serviceType));\r
- }\r
-\r
- /// <summary>\r
- /// Build Up\r
- /// </summary>\r
- /// <param name="instance">\r
- /// The instance.\r
- /// </param>\r
- protected override void BuildUp(object instance)\r
- {\r
- container.SatisfyImportsOnce(instance);\r
- }\r
- }\r
-}
\ No newline at end of file
\r
namespace HandBrakeWPF.ViewModels\r
{\r
- using System.ComponentModel.Composition;\r
-\r
using Caliburn.Micro;\r
\r
using HandBrake.ApplicationServices;\r
/// <summary>\r
/// The About View Model\r
/// </summary>\r
- [Export(typeof(IAboutViewModel))]\r
public class AboutViewModel : ViewModelBase, IAboutViewModel\r
{\r
/// <summary>\r
namespace HandBrakeWPF.ViewModels\r
{\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
using System.Windows;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Add Preset View Model\r
/// </summary>\r
- [Export(typeof(IAddPresetViewModel))]\r
public class AddPresetViewModel : ViewModelBase, IAddPresetViewModel\r
{\r
/// <summary>\r
{\r
using System;\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
using System.Globalization;\r
using System.Linq;\r
\r
/// <summary>\r
/// The Advanced View Model\r
/// </summary>\r
- [Export(typeof(IAdvancedViewModel))]\r
public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel\r
{\r
#region Constants and Fields\r
using System.Collections.Generic;\r
using System.Collections.ObjectModel;\r
using System.Collections.Specialized;\r
- using System.ComponentModel.Composition;\r
using System.Linq;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Audio View Model\r
/// </summary>\r
- [Export(typeof(IAudioViewModel))]\r
public class AudioViewModel : ViewModelBase, IAudioViewModel\r
{\r
/// <summary>\r
using System;\r
using System.Collections.Generic;\r
using System.Collections.ObjectModel;\r
- using System.ComponentModel.Composition;\r
using System.IO;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Chapters View Model\r
/// </summary>\r
- [Export(typeof(IChaptersViewModel))]\r
public class ChaptersViewModel : ViewModelBase, IChaptersViewModel\r
{\r
/// <summary>\r
namespace HandBrakeWPF.ViewModels\r
{\r
using System;\r
- using System.ComponentModel.Composition;\r
using System.Windows;\r
\r
using HandBrakeWPF.ViewModels.Interfaces;\r
/// <summary>\r
/// The Error View Model\r
/// </summary>\r
- [Export(typeof(IErrorViewModel))]\r
public class ErrorViewModel : ViewModelBase, IErrorViewModel\r
{\r
#region Constants and Fields\r
namespace HandBrakeWPF.ViewModels\r
{\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
\r
using Caliburn.Micro;\r
\r
/// <summary>\r
/// The Filters View Model\r
/// </summary>\r
- [Export(typeof(IFiltersViewModel))]\r
public class FiltersViewModel : ViewModelBase, IFiltersViewModel\r
{\r
#region Constructors and Destructors\r
{\r
using System;\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
using System.Diagnostics;\r
using System.IO;\r
using System.Linq;\r
/// <summary>\r
/// HandBrakes Main Window\r
/// </summary>\r
- [Export(typeof(IMainViewModel))]\r
public class MainViewModel : ViewModelBase, IMainViewModel\r
{\r
#region Private Variables and Services\r
/// <param name="driveDetectService">\r
/// The drive Detect Service.\r
/// </param>\r
- [ImportingConstructor]\r
public MainViewModel(IWindowManager windowManager, IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,\r
IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService)\r
{\r
using System.Collections.Generic;\r
using System.Collections.Specialized;\r
using System.ComponentModel;\r
- using System.ComponentModel.Composition;\r
using System.Diagnostics;\r
using System.Globalization;\r
using System.IO;\r
/// <summary>\r
/// The Options View Model\r
/// </summary>\r
- [Export(typeof(IOptionsViewModel))]\r
public class OptionsViewModel : ViewModelBase, IOptionsViewModel\r
{\r
#region Constants and Fields\r
{\r
using System;\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
using System.Drawing;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Picture Settings View Model\r
/// </summary>\r
- [Export(typeof(IPictureSettingsViewModel))]\r
public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel\r
{\r
/*\r
{\r
using System;\r
using System.Collections.ObjectModel;\r
- using System.ComponentModel.Composition;\r
using System.Windows;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Preview View Model\r
/// </summary>\r
- [Export(typeof(IQueueViewModel))]\r
public class QueueViewModel : ViewModelBase, IQueueViewModel\r
{\r
#region Constants and Fields\r
\r
namespace HandBrakeWPF.ViewModels\r
{\r
- using System.ComponentModel.Composition;\r
using System.Windows;\r
\r
using Caliburn.Micro;\r
/// <summary>\r
/// The Shell View Model\r
/// </summary>\r
- [Export(typeof(IShellViewModel))]\r
public class ShellViewModel : ViewModelBase, IShellViewModel\r
{\r
/// <summary>\r
{\r
using System.Collections.Generic;\r
using System.Collections.Specialized;\r
- using System.ComponentModel.Composition;\r
using System.IO;\r
using System.Linq;\r
\r
/// <summary>\r
/// The Subtitles View Model\r
/// </summary>\r
- [Export(typeof(ISubtitlesViewModel))]\r
public class SubtitlesViewModel : ViewModelBase, ISubtitlesViewModel\r
{\r
#region Constants and Fields\r
\r
namespace HandBrakeWPF.ViewModels\r
{\r
- using System.ComponentModel.Composition;\r
-\r
using HandBrakeWPF.ViewModels.Interfaces;\r
\r
/// <summary>\r
/// The Title Specific View Model\r
/// </summary>\r
- [Export(typeof(ITitleSpecificViewModel))]\r
public class TitleSpecificViewModel : ViewModelBase, ITitleSpecificViewModel\r
{\r
#region Constants and Fields\r
{\r
using System;\r
using System.Collections.Generic;\r
- using System.ComponentModel.Composition;\r
using System.Globalization;\r
\r
using Caliburn.Micro;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
using HandBrake.Interop.Model.Encoding;\r
- using HandBrake.Interop.Model.Encoding.x264;\r
\r
using HandBrakeWPF.ViewModels.Interfaces;\r
\r
/// <summary>\r
/// The Video View Model\r
/// </summary>\r
- [Export(typeof(IVideoViewModel))]\r
public class VideoViewModel : ViewModelBase, IVideoViewModel\r
{\r
#region Constants and Fields\r
\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
\r
- using HandBrakeWPF.Services.Interfaces;\r
using HandBrakeWPF.ViewModels.Interfaces;\r
\r
/// <summary>\r