From da20e8dcd2867df0a9a6ebc1081edb2db2eebdef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 29 Oct 2016 16:02:21 -0400 Subject: continue with .net core targeting --- .../ApplicationHost.cs | 110 +-------------------- .../MediaBrowser.Server.Startup.Common.csproj | 7 +- .../Migrations/DbMigration.cs | 1 - .../Migrations/UpdateLevelMigration.cs | 2 +- 4 files changed, 9 insertions(+), 111 deletions(-) (limited to 'MediaBrowser.Server.Startup.Common') diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index b26edb895..459500792 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -7,7 +7,7 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Events; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Implementations; -using MediaBrowser.Common.Implementations.ScheduledTasks; +using Emby.Common.Implementations.ScheduledTasks; using MediaBrowser.Common.Net; using MediaBrowser.Common.Progress; using MediaBrowser.Controller; @@ -96,13 +96,12 @@ using System.Net.Sockets; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Emby.Common.Implementations; +using Emby.Common.Implementations.Networking; +using Emby.Common.Implementations.Updates; using Emby.Photos; using MediaBrowser.Model.IO; using MediaBrowser.Api.Playback; -using MediaBrowser.Common.Implementations.Networking; -using MediaBrowser.Common.Implementations.Serialization; -using MediaBrowser.Common.Implementations.Updates; -using MediaBrowser.Common.IO; using MediaBrowser.Common.Plugins; using MediaBrowser.Common.Security; using MediaBrowser.Common.Updates; @@ -111,6 +110,7 @@ using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.IO; using MediaBrowser.Model.Activity; +using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Net; using MediaBrowser.Model.News; @@ -251,11 +251,6 @@ namespace MediaBrowser.Server.Startup.Common internal INativeApp NativeApp { get; set; } - /// - /// The container - /// - protected readonly SimpleInjector.Container Container = new SimpleInjector.Container(); - /// /// Initializes a new instance of the class. /// @@ -1750,115 +1745,20 @@ namespace MediaBrowser.Server.Startup.Common } } - /// - /// Creates an instance of type and resolves all constructor dependancies - /// - /// The type. - /// System.Object. - public override object CreateInstance(Type type) - { - try - { - return Container.GetInstance(type); - } - catch (Exception ex) - { - Logger.ErrorException("Error creating {0}", ex, type.FullName); - - throw; - } - } - - /// - /// Creates the instance safe. - /// - /// The type. - /// System.Object. - protected override object CreateInstanceSafe(Type type) - { - try - { - return Container.GetInstance(type); - } - catch (Exception ex) - { - Logger.ErrorException("Error creating {0}", ex, type.FullName); - // Don't blow up in release mode - return null; - } - } - void IDependencyContainer.RegisterSingleInstance(T obj, bool manageLifetime) { RegisterSingleInstance(obj, manageLifetime); } - /// - /// Registers the specified obj. - /// - /// - /// The obj. - /// if set to true [manage lifetime]. - protected override void RegisterSingleInstance(T obj, bool manageLifetime = true) - { - Container.RegisterSingleton(obj); - - if (manageLifetime) - { - var disposable = obj as IDisposable; - - if (disposable != null) - { - DisposableParts.Add(disposable); - } - } - } - void IDependencyContainer.RegisterSingleInstance(Func func) { RegisterSingleInstance(func); } - /// - /// Registers the single instance. - /// - /// - /// The func. - protected override void RegisterSingleInstance(Func func) - { - Container.RegisterSingleton(func); - } - void IDependencyContainer.Register(Type typeInterface, Type typeImplementation) { Container.Register(typeInterface, typeImplementation); } - /// - /// Resolves this instance. - /// - /// - /// ``0. - public override T Resolve() - { - return (T)Container.GetRegistration(typeof(T), true).GetInstance(); - } - - /// - /// Resolves this instance. - /// - /// - /// ``0. - public override T TryResolve() - { - var result = Container.GetRegistration(typeof(T), false); - - if (result == null) - { - return default(T); - } - return (T)result.GetInstance(); - } - } } diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index 53dbac53f..4c2a78452 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -32,6 +32,9 @@ 4 + + ..\ThirdParty\emby\Emby.Common.Implementations.dll + False ..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll @@ -97,10 +100,6 @@ {4fd51ac5-2c16-4308-a993-c3a84f3b4582} MediaBrowser.Api - - {c4d2573a-3fd3-441f-81af-174ac4cd4e1d} - MediaBrowser.Common.Implementations - {9142eefa-7570-41e1-bfcc-468bb571af2f} MediaBrowser.Common diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs index 5705b3a59..4a1b4000e 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs @@ -1,5 +1,4 @@ using System.Threading.Tasks; -using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Tasks; using MediaBrowser.Server.Implementations.Persistence; diff --git a/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs index 8483ca904..b0214041b 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Common.Implementations.Updates; +using Emby.Common.Implementations.Updates; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; -- cgit v1.2.3