From a2ae2630bbc8a8eb16e443698aa05367b4e71daa Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Thu, 14 Mar 2013 13:16:07 -0400 Subject: Need to delay building of IRequiresRegistration until other parts are registered. --- .../Security/PluginSecurityManager.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Common.Implementations') diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index c345e122f..6ac4d2d5d 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -47,6 +47,13 @@ namespace MediaBrowser.Common.Implementations.Security private IJsonSerializer _jsonSerializer; private IApplicationHost _appHost; private IEnumerable _registeredEntities; + protected IEnumerable RegisteredEntities + { + get + { + return _registeredEntities ?? (_registeredEntities = _appHost.GetExports()); + } + } /// /// Initializes a new instance of the class. @@ -61,7 +68,6 @@ namespace MediaBrowser.Common.Implementations.Security _appHost = appHost; _httpClient = httpClient; _jsonSerializer = jsonSerializer; - _registeredEntities = _appHost.GetExports(); MBRegistration.Init(appPaths); } @@ -74,7 +80,7 @@ namespace MediaBrowser.Common.Implementations.Security var tasks = new List(); ResetSupporterInfo(); - tasks.AddRange(_registeredEntities.Select(i => i.LoadRegistrationInfoAsync())); + tasks.AddRange(RegisteredEntities.Select(i => i.LoadRegistrationInfoAsync())); await Task.WhenAll(tasks); } -- cgit v1.2.3 From f3b367628a8a36ced1db3ae1660c8b68542d1458 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Thu, 14 Mar 2013 14:22:58 -0400 Subject: One more shot at #19 --- MediaBrowser.Common.Implementations/BaseApplicationHost.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Common.Implementations') diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs index 1789ab298..40c91979d 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs @@ -500,14 +500,14 @@ namespace MediaBrowser.Common.Implementations if (ConfigurationManager.CommonConfiguration.RunAtStartup) { //Copy our shortut into the startup folder for this user - File.Copy(ProductShortcutPath, Environment.GetFolderPath(Environment.SpecialFolder.Startup), true); + File.Copy(ProductShortcutPath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup),Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk"), true); } else { //Remove our shortcut from the startup folder for this user try { - File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath))); + File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk")); } catch (FileNotFoundException) { -- cgit v1.2.3