mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
24 lines
560 B
C#
24 lines
560 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Mono.Cecil;
|
|
|
|
namespace MonoCecilToEcmaCil1
|
|
{
|
|
public static class CecilExtensions
|
|
{
|
|
public static bool IsSubclassOf(this TypeDefinition aThis, TypeDefinition aThat)
|
|
{
|
|
if (aThis.Equals(aThat))
|
|
{
|
|
return true;
|
|
}
|
|
if (aThis.BaseType != null)
|
|
{
|
|
return aThis.BaseType.Resolve().IsSubclassOf(aThat);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|