Rediger

Del via


MetadataBuilder.AddDeclarativeSecurityAttribute Method

Definition

Adds a declarative security attribute to a type, method, or assembly.

public:
 System::Reflection::Metadata::DeclarativeSecurityAttributeHandle AddDeclarativeSecurityAttribute(System::Reflection::Metadata::EntityHandle parent, System::Reflection::DeclarativeSecurityAction action, System::Reflection::Metadata::BlobHandle permissionSet);
public System.Reflection.Metadata.DeclarativeSecurityAttributeHandle AddDeclarativeSecurityAttribute (System.Reflection.Metadata.EntityHandle parent, System.Reflection.DeclarativeSecurityAction action, System.Reflection.Metadata.BlobHandle permissionSet);
member this.AddDeclarativeSecurityAttribute : System.Reflection.Metadata.EntityHandle * System.Reflection.DeclarativeSecurityAction * System.Reflection.Metadata.BlobHandle -> System.Reflection.Metadata.DeclarativeSecurityAttributeHandle
Public Function AddDeclarativeSecurityAttribute (parent As EntityHandle, action As DeclarativeSecurityAction, permissionSet As BlobHandle) As DeclarativeSecurityAttributeHandle

Parameters

parent
EntityHandle

The parent entity handle, which can be one of the following: a TypeDefinitionHandle, MethodDefinitionHandle, or a AssemblyDefinitionHandle.

action
DeclarativeSecurityAction

A declarative security action.

permissionSet
BlobHandle

The permission set blob.

Returns

A handle to the added declarative security 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