12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- namespace Wayne.Lib
- {
-
-
-
- public static class Events
- {
-
-
-
-
-
-
-
- public static void Fire<TEventArgs>(this EventHandler<TEventArgs> eventHandler, object sender, TEventArgs eventArgs)
- where TEventArgs : EventArgs
- {
- if (eventHandler != null)
- {
- eventHandler(sender, eventArgs);
- }
- }
-
-
-
-
-
-
- public static void Fire(this EventHandler eventHandler, object sender, EventArgs eventArgs)
- {
- if (eventHandler != null)
- {
- eventHandler(sender, eventArgs);
- }
- }
-
-
-
-
- public static void Fire(this Action action)
- {
- if (action != null)
- {
- action();
- }
- }
-
-
-
-
-
- public static void Fire<T>(this Action<T> action, T t)
- {
- if (action != null)
- {
- action(t);
- }
- }
-
-
-
-
-
-
- public static void Fire<T1, T2>(this Action<T1, T2> action, T1 t1, T2 t2)
- {
- if (action != null)
- {
- action(t1, t2);
- }
- }
-
-
-
-
-
-
-
- public static void Fire<T1, T2, T3>(this Action<T1, T2, T3> action, T1 t1, T2 t2, T3 t3)
- {
- if (action != null)
- {
- action(t1, t2, t3);
- }
- }
- }
- }
|