mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-12 05:34:33 +00:00
31 lines
801 B
C#
31 lines
801 B
C#
using System;
|
|
|
|
namespace SocketIOClient.Extensions
|
|
{
|
|
internal static class SocketIOEventExtensions
|
|
{
|
|
public static void TryInvoke(this OnAnyHandler handler, string eventName, SocketIOResponse response)
|
|
{
|
|
try
|
|
{
|
|
handler(eventName, response);
|
|
}
|
|
catch
|
|
{
|
|
// The exception is thrown by the user code, so it can be swallowed
|
|
}
|
|
}
|
|
public static void TryInvoke(this Action<SocketIOResponse> handler, SocketIOResponse response)
|
|
{
|
|
try
|
|
{
|
|
handler(response);
|
|
}
|
|
catch
|
|
{
|
|
// The exception is thrown by the user code, so it can be swallowed
|
|
}
|
|
}
|
|
}
|
|
}
|