|
|
@ -557,7 +557,6 @@ namespace QFrameworkCP |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region IOC |
|
|
|
#region IOC |
|
|
|
|
|
|
|
|
|
|
|
public class IOCContainer |
|
|
|
public class IOCContainer |
|
|
|
{ |
|
|
|
{ |
|
|
|
private Dictionary<Type, object> mInstances = new Dictionary<Type, object>(); |
|
|
|
private Dictionary<Type, object> mInstances = new Dictionary<Type, object>(); |
|
|
@ -597,26 +596,6 @@ namespace QFrameworkCP |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class EasyEvent : IEasyEvent |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
private Action mOnEvent = () => { }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IUnRegister Register(Action onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent += onEvent; |
|
|
|
|
|
|
|
return new CustomUnRegister(() => { UnRegister(onEvent); }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UnRegister(Action onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent -= onEvent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Trigger() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent?.Invoke(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EasyEvent<T> : IEasyEvent |
|
|
|
public class EasyEvent<T> : IEasyEvent |
|
|
|
{ |
|
|
|
{ |
|
|
@ -639,48 +618,6 @@ namespace QFrameworkCP |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class EasyEvent<T, K> : IEasyEvent |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
private Action<T, K> mOnEvent = (t, k) => { }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IUnRegister Register(Action<T, K> onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent += onEvent; |
|
|
|
|
|
|
|
return new CustomUnRegister(() => { UnRegister(onEvent); }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UnRegister(Action<T, K> onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent -= onEvent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Trigger(T t, K k) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent?.Invoke(t, k); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EasyEvent<T, K, S> : IEasyEvent |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
private Action<T, K, S> mOnEvent = (t, k, s) => { }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IUnRegister Register(Action<T, K, S> onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent += onEvent; |
|
|
|
|
|
|
|
return new CustomUnRegister(() => { UnRegister(onEvent); }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UnRegister(Action<T, K, S> onEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent -= onEvent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Trigger(T t, K k, S s) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mOnEvent?.Invoke(t, k, s); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EasyEvents |
|
|
|
public class EasyEvents |
|
|
|
{ |
|
|
|
{ |
|
|
|
private static EasyEvents mGlobalEvents = new EasyEvents(); |
|
|
|
private static EasyEvents mGlobalEvents = new EasyEvents(); |
|
|
|