private static TypeDefinition GetTypeDefinition(ModuleDefinition module, TypeReference type) { if (!type.IsNested) { return(module.GetType(type.Namespace, type.Name)); } TypeDefinition self = type.DeclaringType.Resolve(); return((self != null) ? self.GetNestedType(type.TypeFullName()) : null); }
static TypeDefinition GetTypeDefinition(ModuleDefinition module, TypeReference type) { if (!type.IsNested) { var t = module.GetType(type.Namespace, type.Name); return(t); } var declaring_type = type.DeclaringType.Resolve(); return(declaring_type?.GetNestedType(type.TypeFullName())); }
private static TypeDefinition GetTypeDefinition(ModuleDefinition module, TypeReference type) { if (!type.IsNested) { return(module.GetType(type.Namespace, type.Name)); } TypeDefinition typeDefinition = type.DeclaringType.Resolve(); if (typeDefinition == null) { return(null); } return(typeDefinition.GetNestedType(type.TypeFullName())); }
static TypeDefinition GetTypeDefinition (ModuleDefinition module, TypeReference type) { if (!type.IsNested) return module.GetType (type.Namespace, type.Name); var declaring_type = type.DeclaringType.Resolve (); if (declaring_type == null) return null; return declaring_type.GetNestedType (type.TypeFullName ()); }