EventDeclaration Class |
Represents an event (Event).
System.Object
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.NamedPositionedMetadataDeclaration
PostSharp.Sdk.CodeModel.MethodGroupDeclaration
PostSharp.Sdk.CodeModel.EventDeclaration
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.NamedPositionedMetadataDeclaration
PostSharp.Sdk.CodeModel.MethodGroupDeclaration
PostSharp.Sdk.CodeModel.EventDeclaration
Namespace: PostSharp.Sdk.CodeModel
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public sealed class EventDeclaration : MethodGroupDeclaration, IRemovable, IMetadataDeclaration, IDeclaration, IElement, IModuleElement, ITaggable, IWriteReflectionName
The EventDeclaration type exposes the following members.
Name | Description | |
---|---|---|
EventDeclaration | Initializes a new instance of the EventDeclaration class |
Name | Description | |
---|---|---|
Attributes |
Gets or sets the event attributes.
| |
CustomDebuggingInformation | (Inherited from Declaration.) | |
DeclaringType |
Gets the parent TypeDefDeclaration.
(Inherited from MethodGroupDeclaration.) | |
EventType |
Gets or sets the type of the event handler.
| |
IsOriginal |
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.) | |
IsStatic |
Determines whether the current member is static.
(Inherited from MethodGroupDeclaration.) | |
MetadataToken |
Gets or sets the token of the current declaration.
(Inherited from MetadataDeclaration.) | |
Name |
Gets or sets the name of the current declaration.
(Inherited from NamedMetadataDeclaration.) | |
Ordinal | (Inherited from NamedPositionedMetadataDeclaration.) | |
OriginalDeclaration |
When the declaration represents another declaration in the source assembly, this property refers to this declaration.
When using GetReflectionObject(Type[], Type[], BindingOptions), the original declaration should actually be retrieved.
(Inherited from MetadataDeclaration.) | |
OriginalName | (Inherited from NamedMetadataDeclaration.) | |
ParentMember |
Gets the parent member of the current declaration.
(Inherited from MethodGroupDeclaration.) | |
ParentType |
Gets the parent type of the current declaration.
(Inherited from MethodGroupDeclaration.) | |
Visibility |
Gets the visibility of the current element.
(Inherited from MethodGroupDeclaration.) |
Name | Description | |
---|---|---|
ClearCache |
Clear the cache (typically mapping to System.Reflection or,
if the current element is a reference, to the related definition)
of the current Element and all its children.
(Overrides Element.ClearCache().) | |
Dispose | Obsolete. (Inherited from MetadataDeclaration.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetAccessor |
Gets an accessor method.
(Inherited from MethodGroupDeclaration.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetSystemEvent() |
Gets the system runtime event corresponding to the current event.
| |
GetSystemEvent(BindingOptions) |
Gets a reflection EventInfo that wraps the current event.
| |
GetTag<T> |
Gets a tag associated with the current declaration.
(Inherited from MetadataDeclaration.) | |
GetTokenType |
Gets the TokenType of the derived declaration.
(Overrides MetadataDeclaration.GetTokenType().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Remove |
Remove the current declaration from its parent.
| |
SetTag<T> |
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.) | |
ToString | (Inherited from MethodGroupDeclaration.) | |
WriteReflectionName(StringBuilder, ReflectionNameOptions) |
Writes the name of the current declaration to a StringBuilder.
| |
WriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper) |
Writes the name of the current declaration to a StringBuilder and
specifies a NameMapper.
(Overrides MethodGroupDeclaration.WriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper).) |
Name | Description | |
---|---|---|
GetDisplayName |
Gets the name of a given declaration as it should be displayed to the user.
(Defined by WriteReflectionNameExtensions.) | |
GetReflectionName() | Overloaded.
Gets the name of a given declaration and returns a string that is compatible with the result of the ToString
method of system reflection objects.
(Defined by WriteReflectionNameExtensions.) | |
GetReflectionName(ReflectionNameOptions) | Overloaded.
Gets the name of a given declaration and returns a string that is compatible with the result of the ToString
method of system reflection objects.
(Defined by WriteReflectionNameExtensions.) | |
GetReflectionName(ReflectionNameOptions, NameMapper) | Overloaded.
Gets the name of a given declaration, constructed using given options.
(Defined by WriteReflectionNameExtensions.) |
Events are owned by types (TypeDefDeclaration) and
are exposed on the Events property.