mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: Clarifying method usage
This commit is contained in:
parent
6e056c9dcc
commit
9df5f7ae37
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue