12 private string m_strParamName;
14 private int m_iPosition;
22 internal int MetadataTokenInternal => m_pdToken.
Token;
26 public virtual string Name => m_strParamName;
52 [SecuritySafeCritical]
53 [Obsolete(
"An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
56 if (unmanagedMarshal ==
null)
60 byte[] array = unmanagedMarshal.InternalGetBytes();
61 TypeBuilder.SetFieldMarshal(m_methodBuilder.GetModuleBuilder().GetNativeHandle(), m_pdToken.
Token, array, array.Length);
67 [SecuritySafeCritical]
70 TypeBuilder.SetConstantValue(m_methodBuilder.GetModuleBuilder(), m_pdToken.
Token, (m_iPosition == 0) ? m_methodBuilder.
ReturnType : m_methodBuilder.m_parameterTypes[m_iPosition - 1], defaultValue);
78 [SecuritySafeCritical]
86 if (binaryAttribute ==
null)
90 TypeBuilder.DefineCustomAttribute(m_methodBuilder.GetModuleBuilder(), m_pdToken.
Token, ((
ModuleBuilder)m_methodBuilder.
GetModule()).GetConstructorToken(con).Token, binaryAttribute, toDisk:
false, updateCompilerFlags:
false);
97 [SecuritySafeCritical]
100 if (customBuilder ==
null)
112 internal ParameterBuilder(MethodBuilder methodBuilder,
int sequence,
ParameterAttributes attributes,
string strParamName)
114 m_iPosition = sequence;
115 m_strParamName = strParamName;
116 m_methodBuilder = methodBuilder;
117 m_strParamName = strParamName;
118 m_attributes = attributes;
119 m_pdToken =
new ParameterToken(TypeBuilder.SetParamInfo(m_methodBuilder.GetModuleBuilder().GetNativeHandle(), m_methodBuilder.
GetToken().
Token, sequence, attributes, strParamName));
169 void _ParameterBuilder.
Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid,
short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
171 throw new NotImplementedException();
Module GetModule()
Returns a reference to the module that contains this method.
bool IsOptional
Retrieves whether this parameter is optional.
virtual int Position
Retrieves the signature position for this parameter.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
Set a custom attribute using a specified custom attribute blob.
int Token
Retrieves the metadata token for this parameter.
MethodToken GetToken()
Returns the MethodToken that represents the token for this method.
Discovers the attributes of a class constructor and provides access to constructor metadata.
virtual int Attributes
Retrieves the attributes for this parameter.
virtual string Name
Retrieves the name of this parameter.
Exposes the T:System.Reflection.Emit.ParameterBuilder class to unmanaged code.
Helps build custom attributes.
Creates or associates parameter information.
void GetTypeInfoCount(out uint pcTInfo)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
Represents a globally unique identifier (GUID).To browse the .NET Framework source code for this type...
Defines and creates new instances of classes during run time.
bool IsOut
Retrieves whether this parameter is an output parameter.
Defines and represents a module in a dynamic assembly.
A platform-specific type that is used to represent a pointer or a handle.
virtual void SetConstant(object defaultValue)
Sets the default value of the parameter.
ParameterAttributes
Defines the attributes that can be associated with a parameter. These are defined in CorHdr....
override Type ReturnType
Gets the return type of the method represented by this T:System.Reflection.Emit.MethodBuilder.
Defines and represents a method (or constructor) on a dynamic class.
Represents the class that describes how to marshal a field from managed to unmanaged code....
void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
Retrieves the type information for an object, which can be used to get the type information for an in...
bool IsIn
Retrieves whether this is an input parameter.
int Token
Returns the metadata token for this method.
void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
Maps a set of names to a corresponding set of dispatch identifiers.
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
virtual ParameterToken GetToken()
Retrieves the token for this parameter.
The ParameterToken struct is an opaque representation of the token returned by the metadata to repres...
virtual void SetMarshal(UnmanagedMarshal unmanagedMarshal)
Specifies the marshaling for this parameter.
void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
Provides access to properties and methods exposed by an object.
The exception that is thrown when a requested method or operation is not implemented.
void SetCustomAttribute(CustomAttributeBuilder customBuilder)
Set a custom attribute using a custom attribute builder.