using System; using System.Runtime.InteropServices; namespace System.Reflection.Emit { /// Creates or associates parameter information. // Token: 0x02000211 RID: 529 [ComVisible(true)] [ComDefaultInterface(typeof(_ParameterBuilder))] [ClassInterface(ClassInterfaceType.None)] public class ParameterBuilder : _ParameterBuilder { // Token: 0x06001BD5 RID: 7125 RVA: 0x00069B08 File Offset: 0x00067D08 internal ParameterBuilder(MethodBase mb, int pos, ParameterAttributes attributes, string strParamName) { this.name = strParamName; this.position = pos; this.attrs = attributes; this.methodb = mb; if (mb is DynamicMethod) { this.table_idx = 0; } else { this.table_idx = mb.get_next_table_index(this, 8, true); } } /// Maps a set of names to a corresponding set of dispatch identifiers. /// Reserved for future use. Must be IID_NULL. /// Passed-in array of names to be mapped. /// Count of the names to be mapped. /// The locale context in which to interpret the names. /// Caller-allocated array which receives the IDs corresponding to the names. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x06001BD6 RID: 7126 RVA: 0x00069B60 File Offset: 0x00067D60 void _ParameterBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { throw new NotImplementedException(); } /// Retrieves the type information for an object, which can then be used to get the type information for an interface. /// The type information to return. /// The locale identifier for the type information. /// Receives a pointer to the requested type information object. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x06001BD7 RID: 7127 RVA: 0x00069B68 File Offset: 0x00067D68 void _ParameterBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo) { throw new NotImplementedException(); } /// Retrieves the number of type information interfaces that an object provides (either 0 or 1). /// Points to a location that receives the number of type information interfaces provided by the object. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x06001BD8 RID: 7128 RVA: 0x00069B70 File Offset: 0x00067D70 void _ParameterBuilder.GetTypeInfoCount(out uint pcTInfo) { throw new NotImplementedException(); } /// Provides access to properties and methods exposed by an object. /// Identifies the member. /// Reserved for future use. Must be IID_NULL. /// The locale context in which to interpret arguments. /// Flags describing the context of the call. /// Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays. /// Pointer to the location where the result is to be stored. /// Pointer to a structure that contains exception information. /// The index of the first argument that has an error. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x06001BD9 RID: 7129 RVA: 0x00069B78 File Offset: 0x00067D78 void _ParameterBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) { throw new NotImplementedException(); } /// Retrieves the attributes for this parameter. /// Read-only. Retrieves the attributes for this parameter. // Token: 0x170004FB RID: 1275 // (get) Token: 0x06001BDA RID: 7130 RVA: 0x00069B80 File Offset: 0x00067D80 public virtual int Attributes { get { return (int)this.attrs; } } /// Retrieves whether this is an input parameter. /// Read-only. Retrieves whether this is an input parameter. // Token: 0x170004FC RID: 1276 // (get) Token: 0x06001BDB RID: 7131 RVA: 0x00069B88 File Offset: 0x00067D88 public bool IsIn { get { return (this.attrs & ParameterAttributes.In) != ParameterAttributes.None; } } /// Retrieves whether this parameter is an output parameter. /// Read-only. Retrieves whether this parameter is an output parameter. // Token: 0x170004FD RID: 1277 // (get) Token: 0x06001BDC RID: 7132 RVA: 0x00069B98 File Offset: 0x00067D98 public bool IsOut { get { return (this.attrs & ParameterAttributes.Out) != ParameterAttributes.None; } } /// Retrieves whether this parameter is optional. /// Read-only. Specifies whether this parameter is optional. // Token: 0x170004FE RID: 1278 // (get) Token: 0x06001BDD RID: 7133 RVA: 0x00069BA8 File Offset: 0x00067DA8 public bool IsOptional { get { return (this.attrs & ParameterAttributes.Optional) != ParameterAttributes.None; } } /// Retrieves the name of this parameter. /// Read-only. Retrieves the name of this parameter. // Token: 0x170004FF RID: 1279 // (get) Token: 0x06001BDE RID: 7134 RVA: 0x00069BBC File Offset: 0x00067DBC public virtual string Name { get { return this.name; } } /// Retrieves the signature position for this parameter. /// Read-only. Retrieves the signature position for this parameter. // Token: 0x17000500 RID: 1280 // (get) Token: 0x06001BDF RID: 7135 RVA: 0x00069BC4 File Offset: 0x00067DC4 public virtual int Position { get { return this.position; } } /// Retrieves the token for this parameter. /// Returns the token for this parameter. // Token: 0x06001BE0 RID: 7136 RVA: 0x00069BCC File Offset: 0x00067DCC public virtual ParameterToken GetToken() { return new ParameterToken(8 | this.table_idx); } /// Sets the default value of the parameter. /// The default value of this parameter. /// The parameter is not one of the supported types.-or-The type of does not match the type of the parameter.-or-The parameter is of type or other reference type, and is not null. // Token: 0x06001BE1 RID: 7137 RVA: 0x00069BDC File Offset: 0x00067DDC public virtual void SetConstant(object defaultValue) { this.def_value = defaultValue; this.attrs |= ParameterAttributes.HasDefault; } /// Set a custom attribute using a custom attribute builder. /// An instance of a helper class to define the custom attribute. /// /// is null. // Token: 0x06001BE2 RID: 7138 RVA: 0x00069BF8 File Offset: 0x00067DF8 public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { string fullName = customBuilder.Ctor.ReflectedType.FullName; if (fullName == "System.Runtime.InteropServices.InAttribute") { this.attrs |= ParameterAttributes.In; return; } if (fullName == "System.Runtime.InteropServices.OutAttribute") { this.attrs |= ParameterAttributes.Out; return; } if (fullName == "System.Runtime.InteropServices.OptionalAttribute") { this.attrs |= ParameterAttributes.Optional; return; } if (fullName == "System.Runtime.InteropServices.MarshalAsAttribute") { this.attrs |= ParameterAttributes.HasFieldMarshal; this.marshal_info = CustomAttributeBuilder.get_umarshal(customBuilder, false); return; } if (fullName == "System.Runtime.InteropServices.DefaultParameterValueAttribute") { this.SetConstant(CustomAttributeBuilder.decode_cattr(customBuilder).ctorArgs[0]); return; } if (this.cattrs != null) { CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1]; this.cattrs.CopyTo(array, 0); array[this.cattrs.Length] = customBuilder; this.cattrs = array; } else { this.cattrs = new CustomAttributeBuilder[1]; this.cattrs[0] = customBuilder; } } /// Set a custom attribute using a specified custom attribute blob. /// The constructor for the custom attribute. /// A byte blob representing the attributes. /// /// or is null. // Token: 0x06001BE3 RID: 7139 RVA: 0x00069D20 File Offset: 0x00067F20 [ComVisible(true)] public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) { this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute)); } /// Specifies the marshaling for this parameter. /// The marshaling information for this parameter. /// /// is null. // Token: 0x06001BE4 RID: 7140 RVA: 0x00069D30 File Offset: 0x00067F30 [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead.")] public virtual void SetMarshal(UnmanagedMarshal unmanagedMarshal) { this.marshal_info = unmanagedMarshal; this.attrs |= ParameterAttributes.HasFieldMarshal; } // Token: 0x04000962 RID: 2402 private MethodBase methodb; // Token: 0x04000963 RID: 2403 private string name; // Token: 0x04000964 RID: 2404 private CustomAttributeBuilder[] cattrs; // Token: 0x04000965 RID: 2405 private UnmanagedMarshal marshal_info; // Token: 0x04000966 RID: 2406 private ParameterAttributes attrs; // Token: 0x04000967 RID: 2407 private int position; // Token: 0x04000968 RID: 2408 private int table_idx; // Token: 0x04000969 RID: 2409 private object def_value; } }