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 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); this.return_type = new MethodReturnType(this); this.return_type.ReturnType = returnType; this.token = new MetadataToken(TokenType.MemberRef); }
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 TypeReference ImportReference (TypeReference type, IGenericParameterProvider context) { Mixin.CheckType (type); if (type.Module == this) return type; CheckContext (context, this); return MetadataImporter.ImportReference (type, context); }
public ArrayType(TypeReference type, int rank) : this(type) { Mixin.CheckType(type); if (rank == 1) { return; } dimensions = new Collection <ArrayDimension> (rank); for (int i = 0; i < rank; i++) { dimensions.Add(new ArrayDimension()); } this.etype = MD.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: 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 ByReferenceType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.ByRef; }
protected EventReference(string name, TypeReference eventType) : base(name) { Mixin.CheckType(eventType, Mixin.Argument.eventType); event_type = eventType; }
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 = MD.ElementType.Ptr; }
public ArrayType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Array; }
public SentinelType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Sentinel; }
public PinnedType(TypeReference type) : base(type) { Mixin.CheckType(type); this.etype = MD.ElementType.Pinned; }
public CustomAttributeArgument(TypeReference type, object value) { Mixin.CheckType(type); this.type = type; this.value = value; }