From 119dfc3ac70db7536e86191eb3c89ffa1fd4f576 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 20 Sep 2012 11:25:22 -0400 Subject: Adding the UI to the same repo. Made some default theme progress --- MediaBrowser.Common/Kernel/BaseKernel.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Common/Kernel/BaseKernel.cs') diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 5a0e1c5e5..a6081a688 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -1,5 +1,6 @@ using MediaBrowser.Common.Events; using MediaBrowser.Common.Logging; +using MediaBrowser.Common.Mef; using MediaBrowser.Common.Net; using MediaBrowser.Common.Net.Handlers; using MediaBrowser.Common.Plugins; @@ -10,6 +11,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; using System.IO; using System.Linq; using System.Reflection; @@ -88,6 +90,9 @@ namespace MediaBrowser.Common.Kernel /// private IDisposable HttpListener { get; set; } + /// + /// Gets the MEF CompositionContainer + /// private CompositionContainer CompositionContainer { get; set; } protected virtual string HttpServerUrlPrefix @@ -184,18 +189,20 @@ namespace MediaBrowser.Common.Kernel // This will prevent the .dll file from getting locked, and allow us to replace it when needed IEnumerable pluginAssemblies = Directory.GetFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly).Select(f => Assembly.Load(File.ReadAllBytes((f)))); - var catalog = new AggregateCatalog(pluginAssemblies.Select(a => new AssemblyCatalog(a))); + var catalogs = new List(); + + catalogs.AddRange(pluginAssemblies.Select(a => new AssemblyCatalog(a))); // Include composable parts in the Common assembly - catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly())); + catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly())); if (includeCurrentAssembly) { // Include composable parts in the subclass assembly - catalog.Catalogs.Add(new AssemblyCatalog(GetType().Assembly)); + catalogs.Add(new AssemblyCatalog(GetType().Assembly)); } - return new CompositionContainer(catalog); + return MefUtils.GetSafeCompositionContainer(catalogs); } /// -- cgit v1.2.3