MetadataBuilder.AddCustomAttribute Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a custom attribute.
public:
System::Reflection::Metadata::CustomAttributeHandle AddCustomAttribute(System::Reflection::Metadata::EntityHandle parent, System::Reflection::Metadata::EntityHandle constructor, System::Reflection::Metadata::BlobHandle value);
public System.Reflection.Metadata.CustomAttributeHandle AddCustomAttribute (System.Reflection.Metadata.EntityHandle parent, System.Reflection.Metadata.EntityHandle constructor, System.Reflection.Metadata.BlobHandle value);
member this.AddCustomAttribute : System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.BlobHandle -> System.Reflection.Metadata.CustomAttributeHandle
Public Function AddCustomAttribute (parent As EntityHandle, constructor As EntityHandle, value As BlobHandle) As CustomAttributeHandle
Parameters
- parent
- EntityHandle
An entity to attach the custom attribute to: a MethodDefinitionHandle, FieldDefinitionHandle, TypeReferenceHandle, TypeDefinitionHandle, ParameterHandle, InterfaceImplementationHandle, MemberReferenceHandle, ModuleDefinitionHandle, DeclarativeSecurityAttributeHandle, PropertyDefinitionHandle, EventDefinitionHandle, StandaloneSignatureHandle, ModuleReferenceHandle, TypeSpecificationHandle, AssemblyDefinitionHandle, AssemblyReferenceHandle, AssemblyFileHandle, ExportedTypeHandle, ManifestResourceHandle, GenericParameterHandle, GenericParameterConstraintHandle, or a MethodSpecificationHandle.
- constructor
- EntityHandle
A custom attribute constructor: a MethodDefinitionHandle or MemberReferenceHandle.
- value
- BlobHandle
A custom attribute value blob.
Returns
A handle to the added custom attribute.
Exceptions
parent
doesn't have the expected handle kind.
Remarks
Entries may be added in any order. The table is automatically sorted when serialized.
Applies to
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: