mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: Type IsAssignableTo extension shim
This commit is contained in:
parent
fa124a0afc
commit
4a330637a7
1 changed files with 13 additions and 0 deletions
|
|
@ -162,6 +162,19 @@ namespace ICD.Common.Utils.Extensions
|
|||
.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>
|
||||
/// Returns true if the type is assignable to the given type.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue