public OptionalModifierType(TypeReference modifierType, TypeReference type) : base(type) { Mixin.CheckModifier (modifierType, type); this.modifier_type = modifierType; this.etype = MD.ElementType.CModOpt; }
public MethodDefinition(string name, MethodAttributes attributes, TypeReference returnType) : base(name, returnType) { this.attributes = (ushort) attributes; this.HasThis = !this.IsStatic; this.token = new MetadataToken (TokenType.Method); }
internal ParameterReference(string name, TypeReference parameterType) { if (parameterType == null) throw new ArgumentNullException ("parameterType"); this.name = name ?? string.Empty; this.parameter_type = parameterType; }
public FieldReference(string name, TypeReference fieldType, TypeReference declaringType) : this(name, fieldType) { if (declaringType == null) throw new ArgumentNullException("declaringType"); this.DeclaringType = declaringType; }
public MethodReference(string name, TypeReference returnType, TypeReference declaringType) : this(name, returnType) { if (declaringType == null) throw new ArgumentNullException ("declaringType"); this.DeclaringType = declaringType; }
protected EventReference(string name, TypeReference eventType) : base(name) { if (eventType == null) throw new ArgumentNullException ("eventType"); event_type = eventType; }
internal PropertyReference(string name, TypeReference propertyType) : base(name) { if (propertyType == null) throw new ArgumentNullException ("propertyType"); property_type = propertyType; }
public CallSite(TypeReference returnType) : this() { if (returnType == null) throw new ArgumentNullException ("returnType"); this.signature.ReturnType = returnType; }
public FieldReference(string name, TypeReference fieldType) : base(name) { if (fieldType == null) throw new ArgumentNullException ("fieldType"); this.field_type = fieldType; this.token = new MetadataToken (TokenType.MemberRef); }
public MethodReference(string name, TypeReference returnType) : base(name) { if (returnType == null) throw new ArgumentNullException ("returnType"); this.return_type = new MethodReturnType (this); this.return_type.ReturnType = returnType; this.token = new MetadataToken (TokenType.MemberRef); }
public void AddVariableIndex() { var object_ref = new TypeReference ("System", "Object", null, null, false); var method = new MethodDefinition ("foo", MethodAttributes.Static, object_ref); var body = new MethodBody (method); var x = new VariableDefinition ("x", object_ref); var y = new VariableDefinition ("y", object_ref); body.Variables.Add (x); body.Variables.Add (y); Assert.AreEqual (0, x.Index); Assert.AreEqual (1, y.Index); }
public void AddInstruction() { var object_ref = new TypeReference ("System", "Object", null, null, false); var method = new MethodDefinition ("foo", MethodAttributes.Static, object_ref); var body = new MethodBody (method); var il = body.GetILProcessor (); var first = il.Create (OpCodes.Nop); var second = il.Create (OpCodes.Nop); body.Instructions.Add (first); body.Instructions.Add (second); Assert.IsNull (first.Previous); Assert.AreEqual (second, first.Next); Assert.AreEqual (first, second.Previous); Assert.IsNull (second.Next); }
public static void CheckType(TypeReference type) { if (type == null) throw new ArgumentNullException ("type"); }
public GenericInstanceType(TypeReference type) : base(type) { base.IsValueType = type.IsValueType; this.etype = MD.ElementType.GenericInst; }
public RequiredModifierType(TypeReference modifierType, TypeReference type) : base(type) { Mixin.CheckModifier (modifierType, type); this.modifier_type = modifierType; this.etype = MD.ElementType.CModReqD; }
public static void CheckModifier(TypeReference modifierType, TypeReference type) { if (modifierType == null) throw new ArgumentNullException ("modifierType"); if (type == null) throw new ArgumentNullException ("type"); }
public PropertyDefinition(string name, PropertyAttributes attributes, TypeReference propertyType) : base(name, propertyType) { this.attributes = (ushort) attributes; this.token = new MetadataToken (TokenType.Property); }
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 ParameterDefinition(string name, ParameterAttributes attributes, TypeReference parameterType) : base(name, parameterType) { this.attributes = (ushort) attributes; this.token = new MetadataToken (TokenType.Param); }
public ParameterDefinition(TypeReference parameterType) : this(string.Empty, ParameterAttributes.None, parameterType) { }
public SentinelType(TypeReference type) : base(type) { Mixin.CheckType (type); this.etype = MD.ElementType.Sentinel; }
TypeReference LookupSystemValueType(ref TypeReference typeRef, string name, ElementType element_type) { lock (module.SyncRoot) { if (typeRef != null) return typeRef; var type = LookupType ("System", name); type.etype = element_type; type.IsValueType = true; return typeRef = type; } }
TypeReference LookupSystemType(ref TypeReference reference, string name, ElementType element_type) { lock (module.SyncRoot) { if (reference != null) return reference; var type = LookupType ("System", name); type.etype = element_type; return reference = type; } }
internal TypeSpecification(TypeReference type) : base(null, null) { this.element_type = type; this.token = new MetadataToken (TokenType.TypeSpec); }
internal ParameterDefinition(TypeReference parameterType, IMethodSignature method) : this(string.Empty, ParameterAttributes.None, parameterType) { this.method = method; }
public FieldDefinition(string name, FieldAttributes attributes, TypeReference fieldType) : base(name, fieldType) { this.attributes = (ushort) attributes; }
public CustomAttributeArgument(TypeReference type, object value) { Mixin.CheckType (type); this.type = type; this.value = value; }
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 EventDefinition(string name, EventAttributes attributes, TypeReference eventType) : base(name, eventType) { this.attributes = (ushort) attributes; this.token = new MetadataToken (TokenType.Event); }