WIP - have added LightInject as a fast and tiny IoC container that is embedded. Have updated all required SingleObjectResolverBase and non lazy ManyObjectResolverBase to use a Container implementation. Have updated the boot managers to use IoC to instantiate all their requirements. This is so much nicer now by using IoC to ctor all of the objects in these resolvers we can get ctor injection OOTB so no more singletons. Need to create resolver to support the lazy resolver with IoC next. Updated IContentFinders, IThumbnailProviders to use ctor injection.

This commit is contained in:
Shannon
2015-01-21 12:48:08 +11:00
parent 215113d635
commit 13a4d5c81c
65 changed files with 9433 additions and 1174 deletions

View File

@@ -0,0 +1,31 @@
using System;
using System.IO;
using Umbraco.Core.IO;
using Umbraco.Core.Manifest;
namespace Umbraco.Core.Strategies
{
public sealed class ManifestWatcherHandler : ApplicationEventHandler
{
private ManifestWatcher _mw;
protected override void ApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
UmbracoApplicationBase.ApplicationEnd += app_ApplicationEnd;
}
void app_ApplicationEnd(object sender, EventArgs e)
{
if (_mw != null)
{
_mw.Dispose();
}
}
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
_mw = new ManifestWatcher(applicationContext.ProfilingLogger.Logger);
_mw.Start(Directory.GetDirectories(IOHelper.MapPath("~/App_Plugins/")));
}
}
}