Confuser.Core/DnlibUtils.cs
/// <summary>
///     Determines whether the specified type is inherited from a base type in corlib.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="baseType">The full name of base type.</param>
/// <returns><c>true</c> if the specified type is inherited from a base type; otherwise, <c>false</c>.</returns>
// Token: 0x0600014F RID: 335 RVA: 0x0000B884 File Offset: 0x00009A84
Determines whether the specified type is inherited from a base type in corlib.
Determines whether the specified type is inherited from a base type in corlib .
public static bool InheritsFromCorlib(this TypeDef type, string baseType)
		{
			if (type.BaseType == null)
			{
				return false;
			}
			TypeDef bas = type;
			while (true)
			{
				bas = bas.BaseType.ResolveTypeDefThrow();
				if (bas.ReflectionFullName == baseType)
				{
					break;
				}
				if (bas.BaseType == null || !bas.BaseType.DefinitionAssembly.IsCorLib())
				{
					return false;
				}
			}
			return true;
		}
public static bool InheritsFromCorlib ( this TypeDef type , string baseType ) { if ( type . BaseType == null ) { return false ; } TypeDef bas = type ; while ( true ) { bas = bas . BaseType . ResolveTypeDefThrow ( ) ; if ( bas . ReflectionFullName == baseType ) { break ; } if ( bas . BaseType == null || ! bas . BaseType . DefinitionAssembly . IsCorLib ( ) ) { return false ; } } return true ; }
Determines whether the specified type is inherited from a base type in corlib.
Determines whether the specified type is inherited from a base type in corlib .
None
TypeDef
this
baseType
string
The full name of base type.
The full name of base type .
type
None