working on U4-5927 - this extends the base event class to have EventMessages which event consumers can add to, the trick is that there is a factory for these EventMessages, in a web context, the factory is a request based factory so that during a request all instances of the EventMessages are the same instance. All services then accept an instance of IEventMessagesFactory which they can then use when raising events. We'll then use this to send messages to the UI. Not sure if i should make this a resolver yet or not. Still a WIP!!
This commit is contained in:
22
src/Umbraco.Core/Events/EventMessage.cs
Normal file
22
src/Umbraco.Core/Events/EventMessage.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// An event message
|
||||
/// </summary>
|
||||
public sealed class EventMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EventMessage"/> class.
|
||||
/// </summary>
|
||||
public EventMessage(string category, string message, EventMessageType messageType = EventMessageType.Default)
|
||||
{
|
||||
Category = category;
|
||||
Message = message;
|
||||
MessageType = messageType;
|
||||
}
|
||||
|
||||
public string Category { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public EventMessageType MessageType { get; private set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user