mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
33 lines
No EOL
768 B
C#
33 lines
No EOL
768 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace Cosmos.IL2CPU {
|
|
public static class ObjectUtilities {
|
|
public static bool IsDelegate(Type aType) {
|
|
if (aType.FullName == "System.Object") {
|
|
return false;
|
|
}
|
|
if (aType.BaseType.FullName == "System.Delegate") {
|
|
return true;
|
|
}
|
|
if (aType.BaseType.FullName == "System.Object") {
|
|
return false;
|
|
}
|
|
return IsDelegate(aType.BaseType);
|
|
}
|
|
|
|
public static bool IsArray(Type aType) {
|
|
if (aType.FullName == "System.Object") {
|
|
return false;
|
|
}
|
|
if (aType.BaseType.FullName == "System.Array") {
|
|
return true;
|
|
}
|
|
if (aType.BaseType.FullName == "System.Object") {
|
|
return false;
|
|
}
|
|
return IsArray(aType.BaseType);
|
|
}
|
|
}
|
|
} |