Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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()));
        }
Esempio n. 4
0
		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 ());
		}