1
This commit is contained in:
@@ -8,7 +8,7 @@ namespace BITKit
|
||||
{
|
||||
public static IEnumerable<Func<T0, T1>> CastAsFunc<T0, T1>(this Func<T0, T1> self)
|
||||
{
|
||||
return self?.GetInvocationList().Cast<Func<T0, T1>>();
|
||||
return self is null ? Array.Empty<Func<T0,T1>>() : self?.GetInvocationList().Cast<Func<T0, T1>>();
|
||||
}
|
||||
|
||||
public static IEnumerable<Func<T0, T1, T2>> CastAsFunc<T0, T1, T2>(this Func<T0, T1, T2> self)
|
||||
|
@@ -205,11 +205,11 @@ namespace BITKit
|
||||
}
|
||||
public static IEnumerable<T> TrySelectFirst<T>(this IEnumerable<T> self, Action<T> action)
|
||||
{
|
||||
if (self.Count() > 0)
|
||||
if (self.Any())
|
||||
{
|
||||
action.Invoke(self.First());
|
||||
}
|
||||
return self;
|
||||
return self;
|
||||
}
|
||||
public static bool TryGetAny<T>(this IEnumerable<T> self, Func<T, bool> factory, out T any)
|
||||
{
|
||||
|
@@ -58,10 +58,7 @@ namespace BITKit
|
||||
/// 已添加Item的回调
|
||||
/// </summary>
|
||||
event Action<IBasicItem> OnAdd;
|
||||
/// <summary>
|
||||
/// 已使用Item的回调
|
||||
/// </summary>
|
||||
event Action<IBasicItem> OnUsed;
|
||||
|
||||
/// <summary>
|
||||
/// 已移除Item的回调
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user