Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
INotificationService.cs
1using System.Diagnostics.CodeAnalysis;
2using Waher.Events;
5
7{
11 [DefaultImplementation(typeof(NotificationService))]
13 {
19 void ExpectEvent<T>(DateTime Before, Predicate<T> Predicate) where T : NotificationEvent;
20
26
33
38 Task DeleteEvents(params NotificationEvent[] Events);
39
46
53
59 SortedDictionary<CaseInsensitiveString, NotificationEvent[]> GetEventsByCategory(NotificationEventType Type);
60
67 SortedDictionary<CaseInsensitiveString, T[]> GetEventsByCategory<T>(NotificationEventType Type)
68 where T : NotificationEvent;
69
77 bool TryGetNotificationEvents(NotificationEventType Type, CaseInsensitiveString Category, [NotNullWhen(true)] out NotificationEvent[]? Events);
78
84
88 event EventHandlerAsync<NotificationEventArgs>? OnNewNotification;
89
93 event EventHandlerAsync<NotificationEventsArgs>? OnNotificationsDeleted;
94
99
104
109
114
120 }
121}
Class representing an event.
Definition: Event.cs:11
Represents a case-insensitive string.
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...
Interface for event resolvers. Such can be used to resolve multiple pending notifications at once.
Task DeleteEvents(NotificationEventType Type, CaseInsensitiveString Category)
Deletes events for a given button and category.
int NrNotificationsContracts
Number of notifications but button Contracts
EventHandlerAsync< NotificationEventsArgs >? OnNotificationsDeleted
Event raised when notifications have been deleted.
bool TryGetNotificationEvents(NotificationEventType Type, CaseInsensitiveString Category, [NotNullWhen(true)] out NotificationEvent[]? Events)
Tries to get available notification events.
Task NewEvent(NotificationEvent Event)
Registers a new event and notifies the user.
Task DeleteResolvedEvents(IEventResolver Resolver)
Deletes pending events that have already been resolved.
NotificationEvent[] GetAllEvents()
Gets all notification events across all types and categories.
EventHandlerAsync< NotificationEventArgs >? OnNewNotification
Event raised when a new notification has been logged.
int NrNotificationsThings
Number of notifications but button Things
int NrNotificationsWallet
Number of notifications but button Wallet
void ExpectEvent< T >(DateTime Before, Predicate< T > Predicate)
Registers a type of notification as expected.
CaseInsensitiveString[] GetCategories(NotificationEventType Type)
Gets available categories for a button.
SortedDictionary< CaseInsensitiveString, NotificationEvent[]> GetEventsByCategory(NotificationEventType Type)
Gets available notification events for a button, sorted by category.
int NrNotificationsContacts
Number of notifications but button Contacts
NotificationEvent[] GetEvents(NotificationEventType Type)
Gets available notification events for a button.
SortedDictionary< CaseInsensitiveString, T[]> GetEventsByCategory< T >(NotificationEventType Type)
Gets available notification events for a button, of a given type, sorted by category.
Task DeleteEvents(params NotificationEvent[] Events)
Deletes a specified set of events.
abstract class NotificationEvent()
Abstract base class of notification events.
NotificationEventType
Button on which event is to be displayed.