mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
feat: Type IsAssignableTo extension shim
This commit is contained in:
@@ -162,6 +162,19 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
.Assembly;
|
.Assembly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the type is assignable to the given type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="from"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool IsAssignableTo<T>(this Type from)
|
||||||
|
{
|
||||||
|
if (from == null)
|
||||||
|
throw new ArgumentNullException("from");
|
||||||
|
|
||||||
|
return from.IsAssignableTo(typeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if the type is assignable to the given type.
|
/// Returns true if the type is assignable to the given type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user