125 lines
4.5 KiB
C#
125 lines
4.5 KiB
C#
using System;
|
|
|
|
namespace Stary.Evo
|
|
{
|
|
public interface ICanRegisterEvent : IBelongToArchitecture
|
|
{
|
|
}
|
|
|
|
public static class CanRegisterEventExtension
|
|
{
|
|
public static IUnRegister RegisterEvent<T>(this ICanRegisterEvent self, T key, Action onEvent)
|
|
where T : IConvertible
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T, T1>(this ICanRegisterEvent self, T key, Action<T1> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T, T1, T2>(this ICanRegisterEvent self, T key, Action<T1, T2> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T, T1, T2, T3>(this ICanRegisterEvent self, T key,
|
|
Action<T1, T2, T3> onEvent) where T : IConvertible
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T>(this ICanRegisterEvent self, T key, Action<object[]> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
|
|
public static void UnRegisterEvent<T>(this ICanRegisterEvent self, T key, Action onEvent) where T : IConvertible
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T, T1>(this ICanRegisterEvent self, T key, Action<T1> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T, T1, T2>(this ICanRegisterEvent self, T key, Action<T1, T2> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T, T1, T2, T3>(this ICanRegisterEvent self, T key,
|
|
Action<T1, T2, T3> onEvent) where T : IConvertible
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T>(this ICanRegisterEvent self, T key, Action<object[]> onEvent)
|
|
where T : IConvertible
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
|
|
public static IUnRegister RegisterEvent(this ICanRegisterEvent self, string key, Action onEvent)
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T1>(this ICanRegisterEvent self, string key, Action<T1> onEvent)
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T1, T2>(this ICanRegisterEvent self, string key, Action<T1, T2> onEvent)
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent<T1, T2, T3>(this ICanRegisterEvent self, string key,
|
|
Action<T1, T2, T3> onEvent)
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static IUnRegister RegisterEvent(this ICanRegisterEvent self, string key, Action<object[]> onEvent)
|
|
{
|
|
return self.GetArchitecture().RegisterEvent(key, onEvent);
|
|
}
|
|
|
|
|
|
public static void UnRegisterEvent(this ICanRegisterEvent self, string key, Action onEvent)
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T1>(this ICanRegisterEvent self, string key, Action<T1> onEvent)
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T1, T2>(this ICanRegisterEvent self, string key, Action<T1, T2> onEvent)
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent<T1, T2, T3>(this ICanRegisterEvent self, string key,
|
|
Action<T1, T2, T3> onEvent)
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
|
|
public static void UnRegisterEvent(this ICanRegisterEvent self, string key, Action<object[]> onEvent)
|
|
{
|
|
self.GetArchitecture().UnRegisterEvent(key, onEvent);
|
|
}
|
|
}
|
|
} |