mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 03:58:13 +08:00
Fixing some IEventHandler registrations
Some singletong services are not inside the BluePrint and are not recognized as IEventHandlers. The fix is just to manually named those registrations so that the Event Bus finds them. --HG-- branch : 1.x
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Orchard.Environment {
|
||||
builder.RegisterType<DefaultParallelCacheContext>().As<IParallelCacheContext>().SingleInstance();
|
||||
builder.RegisterType<DefaultAsyncTokenProvider>().As<IAsyncTokenProvider>().SingleInstance();
|
||||
builder.RegisterType<DefaultHostEnvironment>().As<IHostEnvironment>().SingleInstance();
|
||||
builder.RegisterType<DefaultHostLocalRestart>().As<IHostLocalRestart>().SingleInstance();
|
||||
builder.RegisterType<DefaultHostLocalRestart>().As<IHostLocalRestart>().Named<IEventHandler>(typeof(IShellSettingsManagerEventHandler).Name).SingleInstance();
|
||||
builder.RegisterType<DefaultBuildManager>().As<IBuildManager>().SingleInstance();
|
||||
builder.RegisterType<WebFormVirtualPathProvider>().As<ICustomVirtualPathProvider>().SingleInstance();
|
||||
builder.RegisterType<DynamicModuleVirtualPathProvider>().As<ICustomVirtualPathProvider>().SingleInstance();
|
||||
@@ -76,7 +76,7 @@ namespace Orchard.Environment {
|
||||
RegisterVolatileProvider<DefaultVirtualPathProvider, IVirtualPathProvider>(builder);
|
||||
|
||||
|
||||
builder.RegisterType<DefaultOrchardHost>().As<IOrchardHost>().As<IEventHandler>().SingleInstance();
|
||||
builder.RegisterType<DefaultOrchardHost>().As<IOrchardHost>().As<IEventHandler>().Named<IEventHandler>(typeof(IShellSettingsManagerEventHandler).Name).SingleInstance();
|
||||
{
|
||||
builder.RegisterType<ShellSettingsManager>().As<IShellSettingsManager>().SingleInstance();
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Orchard.Environment.ShellBuilders {
|
||||
// register named instance for each interface, for efficient filtering inside event bus
|
||||
// IEventHandler derived classes only
|
||||
if (interfaceType.GetInterface(typeof (IEventHandler).Name) != null) {
|
||||
registration = registration.Named(interfaceType.Name, typeof (IEventHandler));
|
||||
registration = registration.Named<IEventHandler>(interfaceType.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user