From d127bb1374cf38d28d2cd86ad7b74d4f34e5ac76 Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 6 Sep 2024 00:50:49 +0200 Subject: [PATCH] Use Action instead of custom event delegate --- GlaxOSC/OSC.cs | 4 ++-- GlaxOSC/OSCEndpoint.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GlaxOSC/OSC.cs b/GlaxOSC/OSC.cs index 05545f5..c995032 100644 --- a/GlaxOSC/OSC.cs +++ b/GlaxOSC/OSC.cs @@ -92,7 +92,7 @@ public class OSC : IDisposable internal void AddEndpoint(OSCEndpoint oscEndpoint) => AddEndpoint(oscEndpoint.Endpoint, oscEndpoint.Type, oscEndpoint.Callback); - internal void AddEndpoint(string endpoint, Type type, OnParameterChangeEventHandler? callback = null) + internal void AddEndpoint(string endpoint, Type type, Action? callback = null) { this._logger?.LogDebug($"Adding endpoint {endpoint}"); Dictionary oscTypeLookup = new Dictionary() @@ -113,7 +113,7 @@ public class OSC : IDisposable this._oscServer.TryAddMethod(endpoint, values => HandleParameterChange(endpoint, type, values, callback)); } - private void HandleParameterChange(string endpoint, Type type, OscMessageValues values, OnParameterChangeEventHandler? callback) + private void HandleParameterChange(string endpoint, Type type, OscMessageValues values, Action? callback) { object? oldValue = ParameterValues[endpoint]; if (type == typeof(int)) diff --git a/GlaxOSC/OSCEndpoint.cs b/GlaxOSC/OSCEndpoint.cs index d8d82bd..f610b6c 100644 --- a/GlaxOSC/OSCEndpoint.cs +++ b/GlaxOSC/OSCEndpoint.cs @@ -4,9 +4,9 @@ public struct OSCEndpoint { public string Endpoint; public Type Type; - public OSC.OnParameterChangeEventHandler? Callback; + public Action? Callback; - public OSCEndpoint(string endpoint, Type type, OSC.OnParameterChangeEventHandler? callback) + public OSCEndpoint(string endpoint, Type type, Action? callback) { this.Endpoint = endpoint; this.Type = type;