private ResolveType ( int metadataToken, IGenericContext context ) : |
||
metadataToken | int | |
context | IGenericContext | |
Résultat |
public override Type[] __GetDeclaredInterfaces() { List <Type> list = null; foreach (int i in module.InterfaceImpl.Filter(this.MetadataToken)) { if (list == null) { list = new List <Type>(); } list.Add(module.ResolveType(module.InterfaceImpl.records[i].Interface, this)); } return(Util.ToArray(list, Type.EmptyTypes)); }
public override Type[] __GetDeclaredInterfaces() { int token = this.MetadataToken; List <Type> list = new List <Type>(); // TODO use binary search? for (int i = 0; i < module.InterfaceImpl.records.Length; i++) { if (module.InterfaceImpl.records[i].Class == token) { list.Add(module.ResolveType(module.InterfaceImpl.records[i].Interface, this)); } } return(list.ToArray()); }
internal ExceptionHandlingClause(ModuleReader module, int flags, int tryOffset, int tryLength, int handlerOffset, int handlerLength, int classTokenOrfilterOffset, IGenericContext context) { this.flags = flags; this.tryOffset = tryOffset; this.tryLength = tryLength; this.handlerOffset = handlerOffset; this.handlerLength = handlerLength; this.catchType = flags == (int)ExceptionHandlingClauseOptions.Clause && classTokenOrfilterOffset != 0 ? module.ResolveType(classTokenOrfilterOffset, context) : null; this.filterOffset = flags == (int)ExceptionHandlingClauseOptions.Filter ? classTokenOrfilterOffset : 0; }
public override Type[] GetGenericParameterConstraints() { IGenericContext context = (this.DeclaringMethod as IGenericContext) ?? this.DeclaringType; List <Type> list = new List <Type>(); foreach (int i in module.GenericParamConstraint.Filter(this.MetadataToken)) { list.Add(module.ResolveType(module.GenericParamConstraint.records[i].Constraint, context)); } return(list.ToArray()); }
public override Type[] GetGenericParameterConstraints() { IGenericContext context = (this.DeclaringMethod as IGenericContext) ?? this.DeclaringType; List <Type> list = new List <Type>(); int token = this.MetadataToken; // TODO use binary search for (int i = 0; i < module.GenericParamConstraint.records.Length; i++) { if (module.GenericParamConstraint.records[i].Owner == token) { list.Add(module.ResolveType(module.GenericParamConstraint.records[i].Constraint, context)); } } return(list.ToArray()); }
internal static Type ReadTypeDefOrRefEncoded(ModuleReader module, ByteReader br, IGenericContext context) { int encoded = br.ReadCompressedUInt(); switch (encoded & 3) { case 0: return module.ResolveType((TypeDefTable.Index << 24) + (encoded >> 2), null, null); case 1: return module.ResolveType((TypeRefTable.Index << 24) + (encoded >> 2), null, null); case 2: return module.ResolveType((TypeSpecTable.Index << 24) + (encoded >> 2), context); default: throw new BadImageFormatException(); } }