Raisin.EventSystem
1.0.1
dotnet add package Raisin.EventSystem --version 1.0.1
NuGet\Install-Package Raisin.EventSystem -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Raisin.EventSystem" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Raisin.EventSystem" Version="1.0.1" />
<PackageReference Include="Raisin.EventSystem" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Raisin.EventSystem --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Raisin.EventSystem, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Raisin.EventSystem@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Raisin.EventSystem&version=1.0.1
#tool nuget:?package=Raisin.EventSystem&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Raisin.EventSystem
Lightweight, thread-safe event bus for .NET 8 applications with automatic UI thread marshalling.
Features
- Publish-subscribe pattern with type-safe event args
- Automatic UI thread marshalling — subscribers registered on the UI thread receive callbacks on the UI thread, no manual dispatching needed
- Filtered subscriptions — subscribe with a predicate to receive only matching events
- Keyed events — route multiple event variants of the same type to different handlers
- Dual dispatch modes — synchronous (
Invoke) for ordered signals, async via thread pool (InvokeOnThreadPool) for fire-and-forget - Resilient — one subscriber throwing does not affect others; errors are routed to an
OnErrorhandler - Zero external dependencies
Installation
dotnet add package Raisin.EventSystem
Quick start
Basic publish and subscribe
var events = new EventSystem();
// Subscribe
events.Subscribe(mySubscriber); // implements IEventSubscriber<MessageArgs>
// Publish
events.Message(this, "Something happened", MessageSeverity.Info, "Category");
Implementing a subscriber
public class MyService : IEventSubscriber<MessageArgs>
{
public void ExecuteEvent(object sender, MessageArgs e)
{
Console.WriteLine($"[{e.Severity}] {e.Message}");
}
public void DestroySubscriber() { /* cleanup */ }
}
Bulk subscription
// Registers all IEventSubscriber<T> interfaces on the object
events.SubscribeAll(myService);
// Unregisters all at once
events.DestroyAll(myService);
Filtered subscription
events.Subscribe(mySubscriber, filter: e => e.Severity >= MessageSeverity.Warning);
Built-in event types
| Type | Fields | Purpose |
|---|---|---|
MessageArgs |
Message, Severity, Category, Subcategory | General application messages |
LogArgs |
Message, Severity, Category, Subcategory | File/diagnostic logging |
AlertArgs |
Type, Message, Symbol, Category | System and domain alerts |
Severity levels: Detail, Verbose, Info, Warning, Error, Critical
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Raisin.EventSystem:
| Package | Downloads |
|---|---|
|
Raisin.Core
Shared core utilities — file logging, atomic writes, credential protection, process watching |
|
|
Raisin.WPF.Base
Shared WPF base library — ViewModelBase, layout helpers, window placement, dark theme utilities |
GitHub repositories
This package is not used by any popular GitHub repositories.