public virtual TypeReference ImportReference(Type type, IGenericParameterProvider context) { Mixin.CheckType(type); return(ImportType( type, ImportGenericContext.For(context), context != null ? ImportGenericKind.Open : ImportGenericKind.Definition)); }
public MethodReference(string name, TypeReference returnType) : base(name) { Mixin.CheckType(returnType, Mixin.Argument.returnType); return_type = new MethodReturnType(this); return_type.ReturnType = returnType; base.token = new MetadataToken(TokenType.MemberRef); }
public FieldReference(string name, TypeReference fieldType) : base(name) { Mixin.CheckType(fieldType, Mixin.Argument.fieldType); this.field_type = fieldType; this.token = new MetadataToken(TokenType.MemberRef); }
public TypeReference ImportReference(TypeReference type, IGenericParameterProvider context) { Mixin.CheckType(type); if (type.Module == this) { return(type); } CheckContext(context, this); return(MetadataImporter.ImportReference(type, context)); }
public OptionalModifierType(TypeReference modifierType, TypeReference type) : base(type) { if (modifierType == null) { throw new ArgumentNullException(9.ToString()); } Mixin.CheckType(type); modifier_type = modifierType; base.etype = Mono.Cecil.Metadata.ElementType.CModOpt; }
public OptionalModifierType(TypeReference modifierType, TypeReference type) : base(type) { if (modifierType == null) { throw new ArgumentNullException(Mixin.Argument.modifierType.ToString()); } Mixin.CheckType(type); this.modifier_type = modifierType; this.etype = MD.ElementType.CModOpt; }
public ArrayType(TypeReference type, int rank) : this(type) { Mixin.CheckType(type); if (rank != 1) { this.dimensions = new Collection <ArrayDimension>(rank); for (int i = 0; i < rank; i++) { ArrayDimension item = new ArrayDimension(); this.dimensions.Add(item); } base.etype = ElementType.Array; } }
public ArrayType(TypeReference type, int rank) : this(type) { Mixin.CheckType(type); if (rank == 1) { return; } this.dimensions = new Collection <ArrayDimension>(rank); for (int i = 0; i < rank; i++) { this.dimensions.Add(new ArrayDimension()); } this.etype = Mono.Cecil.Metadata.ElementType.Array; }
public ArrayType(TypeReference type, int rank) : this(type) { Mixin.CheckType(type); if (rank != 1) { dimensions = new Collection <ArrayDimension>(rank); for (int i = 0; i < rank; i++) { dimensions.Add(default(ArrayDimension)); } base.etype = Mono.Cecil.Metadata.ElementType.Array; } }
public virtual TypeDefinition Resolve(TypeReference type) { Mixin.CheckType(type); type = type.GetElementType(); var scope = type.Scope; if (scope == null) { return(null); } switch (scope.MetadataScopeType) { case MetadataScopeType.AssemblyNameReference: var assembly = assembly_resolver.Resolve((AssemblyNameReference)scope); if (assembly == null) { return(null); } return(GetType(assembly.MainModule, type)); case MetadataScopeType.ModuleDefinition: return(GetType((ModuleDefinition)scope, type)); case MetadataScopeType.ModuleReference: if (type.Module.Assembly == null) { return(null); } var modules = type.Module.Assembly.Modules; var module_ref = (ModuleReference)scope; for (int i = 0; i < modules.Count; i++) { var netmodule = modules [i]; if (netmodule.Name == module_ref.Name) { return(GetType(netmodule, type)); } } break; } throw new NotSupportedException(); }
public virtual TypeDefinition Resolve(TypeReference type) { Mixin.CheckType(type); type = type.GetElementType(); IMetadataScope scope = type.Scope; if (scope == null) { return(null); } switch (scope.MetadataScopeType) { case MetadataScopeType.AssemblyNameReference: { AssemblyDefinition assemblyDefinition = assembly_resolver.Resolve((AssemblyNameReference)scope); if (assemblyDefinition == null) { return(null); } return(GetType(assemblyDefinition.MainModule, type)); } case MetadataScopeType.ModuleDefinition: return(GetType((ModuleDefinition)scope, type)); case MetadataScopeType.ModuleReference: { Collection <ModuleDefinition> modules = type.Module.Assembly.Modules; ModuleReference moduleReference = (ModuleReference)scope; for (int i = 0; i < modules.Count; i++) { ModuleDefinition moduleDefinition = modules[i]; if (moduleDefinition.Name == moduleReference.Name) { return(GetType(moduleDefinition, type)); } } break; } } throw new NotSupportedException(); }
public PointerType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Ptr; }
public PinnedType(TypeReference type) : base(type) { Mixin.CheckType(type); base.etype = ElementType.Pinned; }
public TypeReference ImportReference(Type type, IGenericParameterProvider context) { Mixin.CheckType(type); CheckContext(context, this); return(ReflectionImporter.ImportReference(type, context)); }
public ByReferenceType(TypeReference type) : base(type) { Mixin.CheckType(type); base.etype = Mono.Cecil.Metadata.ElementType.ByRef; }
public InterfaceImplementation(TypeReference interfaceType) { Mixin.CheckType(interfaceType, Mixin.Argument.interfaceType); interface_type = interfaceType; token = new MetadataToken(TokenType.InterfaceImpl); }
public SentinelType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Sentinel; }
internal PropertyReference(string name, TypeReference propertyType) : base(name) { Mixin.CheckType(propertyType, Mixin.Argument.propertyType); property_type = propertyType; }
public SentinelType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = Mono.Cecil.Metadata.ElementType.Sentinel; }
public ByReferenceType(TypeReference type) : base(type) { Mixin.CheckType(type); base.etype = ElementType.ByRef; }
protected EventReference(string name, TypeReference eventType) : base(name) { Mixin.CheckType(eventType, Mixin.Argument.eventType); event_type = eventType; }
public PinnedType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Pinned; }
public virtual TypeReference ImportReference(TypeReference type, IGenericParameterProvider context) { Mixin.CheckType(type); return(ImportType(type, ImportGenericContext.For(context))); }
public PointerType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = Mono.Cecil.Metadata.ElementType.Ptr; }
public ArrayType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Array; }
public PinnedType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = Mono.Cecil.Metadata.ElementType.Pinned; }
public ByReferenceType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.ByRef; }
public ArrayType(TypeReference type) : base(type) { Mixin.CheckType(type); base.etype = ElementType.Array; }
public CustomAttributeArgument(TypeReference type, object value) { Mixin.CheckType(type); this.type = type; this.value = value; }
public ArrayType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = Mono.Cecil.Metadata.ElementType.Array; }