Files
Umbraco-CMS/src/Umbraco.Core/ObjectResolution/ApplicationEventsResolver.cs
Shannon Deminick 65980e8c76 Fixes: #U4-1546 - Moves IApplicationEventHandler to Umbraco.Core and creates UmbracoApplicationBase object in the Core. Changes
signatures of IApplicationEventHandler methods to accept an UmbracoApplicationBase object instead of UmbracoApplication. This allows
us to execute all IApplicationEventHandler's outside of the web context. Added unit test to support booting the application outside of the
web context.
2013-01-29 09:45:12 +06:00

48 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using umbraco.interfaces;
namespace Umbraco.Core.ObjectResolution
{
/// <summary>
/// A resolver to return all IApplicationEvents objects
/// </summary>
internal sealed class ApplicationEventsResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationStartupHandler>
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="applicationEventHandlers"></param>
internal ApplicationEventsResolver(IEnumerable<Type> applicationEventHandlers)
: base(applicationEventHandlers)
{
}
/// <summary>
/// Gets the <see cref="IApplicationEventHandler"/> implementations.
/// </summary>
public IEnumerable<IApplicationEventHandler> ApplicationEventHandlers
{
get { return Values.OfType<IApplicationEventHandler>(); }
}
protected override bool SupportsClear
{
get { return false; }
}
protected override bool SupportsInsert
{
get { return false; }
}
protected override bool SupportsRemove
{
get { return false; }
}
}
}