mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
feat: Clarifying method usage
This commit is contained in:
@@ -147,6 +147,7 @@ namespace ICD.Common.Utils
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[CanBeNull]
|
||||||
public static object GetDefaultValue(Type type)
|
public static object GetDefaultValue(Type type)
|
||||||
{
|
{
|
||||||
if (type == null)
|
if (type == null)
|
||||||
@@ -314,6 +315,7 @@ namespace ICD.Common.Utils
|
|||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[CanBeNull]
|
||||||
public static object ChangeType(object value, Type type)
|
public static object ChangeType(object value, Type type)
|
||||||
{
|
{
|
||||||
if (type == null)
|
if (type == null)
|
||||||
@@ -372,7 +374,9 @@ namespace ICD.Common.Utils
|
|||||||
throw new ArgumentNullException("eventHandler");
|
throw new ArgumentNullException("eventHandler");
|
||||||
|
|
||||||
object handler = eventHandler.Target;
|
object handler = eventHandler.Target;
|
||||||
|
// ReSharper disable InvokeAsExtensionMethod
|
||||||
MethodInfo callback = EventHandlerExtensions.GetMethodInfo(eventHandler);
|
MethodInfo callback = EventHandlerExtensions.GetMethodInfo(eventHandler);
|
||||||
|
// ReSharper restore InvokeAsExtensionMethod
|
||||||
|
|
||||||
return SubscribeEvent(instance, eventInfo, handler, callback);
|
return SubscribeEvent(instance, eventInfo, handler, callback);
|
||||||
}
|
}
|
||||||
@@ -394,7 +398,9 @@ namespace ICD.Common.Utils
|
|||||||
throw new ArgumentNullException("eventHandler");
|
throw new ArgumentNullException("eventHandler");
|
||||||
|
|
||||||
object handler = eventHandler.Target;
|
object handler = eventHandler.Target;
|
||||||
|
// ReSharper disable InvokeAsExtensionMethod
|
||||||
MethodInfo callback = EventHandlerExtensions.GetMethodInfo(eventHandler);
|
MethodInfo callback = EventHandlerExtensions.GetMethodInfo(eventHandler);
|
||||||
|
// ReSharper restore InvokeAsExtensionMethod
|
||||||
|
|
||||||
return SubscribeEvent(instance, eventInfo, handler, callback);
|
return SubscribeEvent(instance, eventInfo, handler, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user