check point

This commit is contained in:
meelstorm
2025-07-14 12:03:59 +02:00
commit d3cb790bd9
431 changed files with 44078 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.ComponentModel;
namespace Inspectron.Settings
{
public static class Event
{
public static void Raise(this EventHandler handler, object sender, EventArgs e)
{
if (handler != null) handler(sender, e);
}
public static void Raise<T>(this EventHandler<T> handler, object sender, T e) where T : EventArgs
{
if (handler != null) handler(sender, e);
}
public static bool RaiseCancellable(this CancelEventHandler handler, object sender, CancelEventArgs e)
{
if (handler != null)
foreach (CancelEventHandler h in handler.GetInvocationList())
{
h(sender, e);
if (e.Cancel) break;
}
return e.Cancel;
}
public static bool RaiseCancellable<T>(this EventHandler<T> handler, object sender, T e)
where T : CancelEventArgs
{
if (handler != null)
foreach (EventHandler<T> h in handler.GetInvocationList())
{
h(sender, e);
if (e.Cancel) break;
}
return e.Cancel;
}
}
}