static private GetTypeHelper ( IntPtr th, IntPtr pGenericArgs, int cGenericArgs, IntPtr pModifiers, int cModifiers ) : IntPtr | ||
th | IntPtr | |
pGenericArgs | IntPtr | |
cGenericArgs | int | |
pModifiers | IntPtr | |
cModifiers | int | |
Результат | IntPtr |
private unsafe Type ConstructType(Func <AssemblyName, Assembly> assemblyResolver, Func <Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark) { Assembly assembly = null; string assemblyName = this.GetAssemblyName(); if (assemblyName.Length > 0) { assembly = TypeNameParser.ResolveAssembly(assemblyName, assemblyResolver, throwOnError, ref stackMark); if (assembly == null) { return(null); } } string[] names = this.GetNames(); if (names == null) { if (throwOnError) { throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); } return(null); } else { Type type = TypeNameParser.ResolveType(assembly, names, typeResolver, throwOnError, ignoreCase, ref stackMark); if (type == null) { return(null); } SafeTypeNameParserHandle[] typeArguments = this.GetTypeArguments(); Type[] array = null; if (typeArguments != null) { array = new Type[typeArguments.Length]; for (int i = 0; i < typeArguments.Length; i++) { using (TypeNameParser typeNameParser = new TypeNameParser(typeArguments[i])) { array[i] = typeNameParser.ConstructType(assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); } if (array[i] == null) { return(null); } } } int[] modifiers = this.GetModifiers(); fixed(int *ptr = modifiers) { IntPtr pModifiers = new IntPtr((void *)ptr); return(RuntimeTypeHandle.GetTypeHelper(type, array, pModifiers, (modifiers == null) ? 0 : modifiers.Length)); } } }
private unsafe Type ConstructType(Func <AssemblyName, Assembly> assemblyResolver, Func <Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark) { Assembly assembly = (Assembly)null; string assemblyName = this.GetAssemblyName(); if (assemblyName.Length > 0) { assembly = TypeNameParser.ResolveAssembly(assemblyName, assemblyResolver, throwOnError, ref stackMark); if (assembly == (Assembly)null) { return((Type)null); } } string[] names = this.GetNames(); if (names == null) { if (throwOnError) { throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); } return((Type)null); } Type typeStart = TypeNameParser.ResolveType(assembly, names, typeResolver, throwOnError, ignoreCase, ref stackMark); if (typeStart == (Type)null) { return((Type)null); } SafeTypeNameParserHandle[] typeArguments = this.GetTypeArguments(); Type[] genericArgs = (Type[])null; if (typeArguments != null) { genericArgs = new Type[typeArguments.Length]; for (int index = 0; index < typeArguments.Length; ++index) { using (TypeNameParser typeNameParser = new TypeNameParser(typeArguments[index])) genericArgs[index] = typeNameParser.ConstructType(assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); if (genericArgs[index] == (Type)null) { return((Type)null); } } } int[] modifiers = this.GetModifiers(); fixed(int *numPtr = modifiers) { IntPtr pModifiers = new IntPtr((void *)numPtr); return(RuntimeTypeHandle.GetTypeHelper(typeStart, genericArgs, pModifiers, modifiers == null ? 0 : modifiers.Length)); } }
private unsafe Type ConstructType( Func <AssemblyName, Assembly> assemblyResolver, Func <Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark) { // assembly name Assembly assembly = null; string asmName = GetAssemblyName(); // GetAssemblyName never returns null Contract.Assert(asmName != null); if (asmName.Length > 0) { assembly = ResolveAssembly(asmName, assemblyResolver, throwOnError, ref stackMark); if (assembly == null) { // Cannot resolve the assembly. If throwOnError is true we should have already thrown. return(null); } } string[] names = GetNames(); if (names == null) { // This can only happen if the type name is an empty string or if the first char is '\0' if (throwOnError) { throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); } return(null); } Type baseType = ResolveType(assembly, names, typeResolver, throwOnError, ignoreCase, ref stackMark); if (baseType == null) { // Cannot resolve the type. If throwOnError is true we should have already thrown. Contract.Assert(throwOnError == false); return(null); } SafeTypeNameParserHandle[] typeArguments = GetTypeArguments(); Type[] types = null; if (typeArguments != null) { types = new Type[typeArguments.Length]; for (int i = 0; i < typeArguments.Length; i++) { Contract.Assert(typeArguments[i] != null); using (TypeNameParser argParser = new TypeNameParser(typeArguments[i])) { types[i] = argParser.ConstructType(assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); } if (types[i] == null) { // If throwOnError is true argParser.ConstructType should have already thrown. Contract.Assert(throwOnError == false); return(null); } } } int[] modifiers = GetModifiers(); fixed(int *ptr = modifiers) { IntPtr intPtr = new IntPtr(ptr); return(RuntimeTypeHandle.GetTypeHelper(baseType, types, intPtr, modifiers == null ? 0 : modifiers.Length)); } }
private unsafe Type ConstructType(Func <AssemblyName, Assembly> assemblyResolver, Func <Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark) { Assembly assembly = null; int[] numArray2; string assemblyName = this.GetAssemblyName(); if (assemblyName.Length > 0) { assembly = ResolveAssembly(assemblyName, assemblyResolver, throwOnError, ref stackMark); if (assembly == null) { return(null); } } string[] names = this.GetNames(); if (names == null) { if (throwOnError) { throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); } return(null); } Type typeStart = ResolveType(assembly, names, typeResolver, throwOnError, ignoreCase, ref stackMark); if (typeStart == null) { return(null); } SafeTypeNameParserHandle[] typeArguments = this.GetTypeArguments(); Type[] genericArgs = null; if (typeArguments != null) { genericArgs = new Type[typeArguments.Length]; for (int i = 0; i < typeArguments.Length; i++) { using (TypeNameParser parser = new TypeNameParser(typeArguments[i])) { genericArgs[i] = parser.ConstructType(assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); } if (genericArgs[i] == null) { return(null); } } } int[] modifiers = this.GetModifiers(); if (((numArray2 = modifiers) == null) || (numArray2.Length == 0)) { numRef = null; goto Label_00EE; } fixed(int *numRef = numArray2) { IntPtr ptr; Label_00EE: ptr = new IntPtr((void *)numRef); return(RuntimeTypeHandle.GetTypeHelper(typeStart, genericArgs, ptr, (modifiers == null) ? 0 : modifiers.Length)); } }