mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Removed IEvents interface
- Replaced by IEventHandler and IEventBus --HG-- branch : dev
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Logging;
|
||||
|
||||
@@ -48,7 +46,7 @@ namespace Orchard.Tests {
|
||||
public object[] LogArgs { get; set; }
|
||||
}
|
||||
|
||||
private interface ITestEvents : IEvents {
|
||||
private interface ITestEvents : IDependency {
|
||||
void Hello(string name);
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Orchard.Core.Feeds.Models;
|
||||
|
||||
namespace Orchard.Core.Feeds {
|
||||
public interface IFeedQueryProvider : IEvents {
|
||||
public interface IFeedQueryProvider : IDependency {
|
||||
FeedQueryMatch Match(FeedContext context);
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.ContentManagement.Drivers.Coordinators {
|
||||
[UsedImplicitly]
|
||||
|
@@ -3,7 +3,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
|
||||
namespace Orchard.ContentManagement.Drivers {
|
||||
public interface IContentFieldDriver : IEvents {
|
||||
public interface IContentFieldDriver : IDependency {
|
||||
DriverResult BuildDisplayModel(BuildDisplayModelContext context);
|
||||
DriverResult BuildEditorModel(BuildEditorModelContext context);
|
||||
DriverResult UpdateEditorModel(UpdateEditorModelContext context);
|
||||
|
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
|
||||
namespace Orchard.ContentManagement.Drivers {
|
||||
public interface IContentItemDriver : IEvents {
|
||||
public interface IContentItemDriver : IDependency {
|
||||
IEnumerable<ContentType> GetContentTypes();
|
||||
void GetContentItemMetadata(GetContentItemMetadataContext context);
|
||||
|
||||
|
@@ -3,7 +3,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
|
||||
namespace Orchard.ContentManagement.Drivers {
|
||||
public interface IContentPartDriver : IEvents {
|
||||
public interface IContentPartDriver : IDependency {
|
||||
DriverResult BuildDisplayModel(BuildDisplayModelContext context);
|
||||
DriverResult BuildEditorModel(BuildEditorModelContext context);
|
||||
DriverResult UpdateEditorModel(UpdateEditorModelContext context);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.ContentManagement.Handlers {
|
||||
public interface IContentHandler : IEvents {
|
||||
public interface IContentHandler : IDependency {
|
||||
IEnumerable<ContentType> GetContentTypes();
|
||||
|
||||
void Activating(ActivatingContentContext context);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Events {
|
||||
public interface IEventBusHandler : IEvents {
|
||||
public interface IEventBusHandler : IDependency {
|
||||
void Process(string messageName, IDictionary<string, string> eventData);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
namespace Orchard.Indexing {
|
||||
public interface IIndexNotifierHandler : IEvents {
|
||||
using Orchard.Events;
|
||||
|
||||
namespace Orchard.Indexing {
|
||||
public interface IIndexNotifierHandler : IEventHandler {
|
||||
void UpdateIndex(string indexName);
|
||||
}
|
||||
}
|
||||
|
@@ -7,11 +7,13 @@ using Orchard.Logging;
|
||||
using Orchard.Security;
|
||||
|
||||
namespace Orchard {
|
||||
public interface IEvents : IDependency {
|
||||
}
|
||||
|
||||
public static class EventsExtensions {
|
||||
public static void Invoke<TEvents>(this IEnumerable<TEvents> events, Action<TEvents> dispatch, ILogger logger) where TEvents : IEvents {
|
||||
public static class InvokeExtensions {
|
||||
|
||||
/// <summary>
|
||||
/// Safely invoke methods by catching non fatal exceptions and logging them
|
||||
/// </summary>
|
||||
public static void Invoke<TEvents>(this IEnumerable<TEvents> events, Action<TEvents> dispatch, ILogger logger) {
|
||||
foreach (var sink in events) {
|
||||
try {
|
||||
dispatch(sink);
|
@@ -649,7 +649,7 @@
|
||||
<Compile Include="Environment\Extensions\Loaders\PrecompiledExtensionLoader.cs" />
|
||||
<Compile Include="Environment\Extensions\Loaders\ReferencedExtensionLoader.cs" />
|
||||
<Compile Include="Environment\Extensions\Folders\ThemeFolders.cs" />
|
||||
<Compile Include="IEvents.cs" />
|
||||
<Compile Include="InvokeExtensions.cs" />
|
||||
<Compile Include="Localization\IText.cs" />
|
||||
<Compile Include="Localization\LocalizationModule.cs" />
|
||||
<Compile Include="Localization\LocalizationUtilities.cs" />
|
||||
|
Reference in New Issue
Block a user