mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added generic type test to path resolve override
This commit is contained in:
1 parent
254a8e311f
commit
d8e803c531
3 files changed
+25
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Artemis.Core.Extensions
|
||||
{
|
||||
public static class TypeExtensions
|
||||
{
|
||||
public static bool IsGenericType(this Type type, Type genericType)
|
||||
{
|
||||
if (type == null)
|
||||
return false;
|
||||
var baseType = type.BaseType;
|
||||
if (baseType == null)
|
||||
return false;
|
||||
|
||||
return baseType.GetGenericTypeDefinition() == genericType;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user