CustomAttributeDeclaration Class |
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.CustomAttributeDeclaration
Namespace: PostSharp.Sdk.CodeModel
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
public sealed class CustomAttributeDeclaration : MetadataDeclaration, IAnnotationInstance, IAnnotationValue, IRemovable, IMetadataDeclaration, IDeclaration, IElement, IModuleElement, ITaggable, ICloneableModuleElement
The CustomAttributeDeclaration type exposes the following members.
Name | Description | |
---|---|---|
CustomAttributeDeclaration(IMethod) |
Initializes a new instance of the CustomAttributeDeclaration type.
| |
CustomAttributeDeclaration(IAnnotationValue, ModuleDeclaration) | Initializes a new instance of the CustomAttributeDeclaration class |
Name | Description | |
---|---|---|
Constructor |
Gets the custom attribute constructor.
| |
CustomDebuggingInformation | (Inherited from Declaration.) | |
IsOriginal |
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.) | |
MetadataToken |
Gets or sets the token of the current declaration.
(Inherited from MetadataDeclaration.) | |
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.) | |
ParentMember |
Gets the parent member of the current declaration.
(Overrides MetadataDeclaration.ParentMember.) | |
ParentType |
Gets the parent type of the current declaration.
(Overrides MetadataDeclaration.ParentType.) | |
Symbol |
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.
(Inherited from Element.) | |
Clone | ||
ConstructRuntimeObject |
Gets the runtime object
constructed from the current instance.
| |
Dispose | Obsolete. (Inherited from MetadataDeclaration.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
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.) | |
InvalidateSerialization |
Invalidates the original serialization. Indicates that
the serialization should be computed again, if requested.
| |
Remove |
Remove the current declaration from its parent.
| |
SetTag<T> |
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.) | |
ToString | (Overrides MetadataDeclaration.ToString().) | |
Translate |
Translates the custom attribute so that it can be used in another module.
|
Name | Description | |
---|---|---|
ConstructRuntimeObject() | Overloaded.
Construct the instance (typically an object derived from Attribute)
represented a given IAnnotationValue. This overload uses
reflection to locate the constructor, and does not work if the target framework
is not .NET Framework.
(Defined by CustomAttributeHelper.) | |
ConstructRuntimeObject(Type) | Overloaded.
Construct the instance represented by a given IAnnotationValue, given its
type passed as an argument. This overload is safe even when the target framework is not
.NET Framework.
(Defined by CustomAttributeHelper.) | |
ConstructRuntimeObject(SerializedValueBindingOptions) | Overloaded.
Construct the instance (typically an object derived from Attribute)
represented a given IAnnotationValue, and specifies options. This overload uses
reflection to locate the constructor, and does not work if the target framework
is not .NET Framework.
(Defined by CustomAttributeHelper.) | |
ConstructRuntimeObject(Type, SerializedValueBindingOptions) | Overloaded.
Construct the instance represented by a given IAnnotationValue, given its
type passed as an argument, and specifies options. This overload is safe even when the target framework is not
.NET Framework.
(Defined by CustomAttributeHelper.) | |
ConstructRuntimeObject<T>() | Overloaded.
Construct the instance represented by a given IAnnotationValue, given its
type passed as a generic argument. This overload is safe even when the target framework is not
.NET Framework.
(Defined by CustomAttributeHelper.) | |
ConstructRuntimeObject<T>(SerializedValueBindingOptions) | Overloaded.
Construct the instance represented by a given IAnnotationValue, given its
type passed as a generic argument, and specifies options. This overload is safe even when the target framework is not
.NET Framework.
(Defined by CustomAttributeHelper.) | |
Render() | Overloaded.
Renders a custom attribute value to a string.
(Defined by CustomAttributeHelper.) | |
Render(StringBuilder) | Overloaded.
Renders a custom attribute value to an existing StringBuilder.
(Defined by CustomAttributeHelper.) | |
SetRuntimeObjectNamedArguments |
Sets the fields and properties of an object (using reflection) given the named arguments of an IAnnotationValue.
(Defined by CustomAttributeHelper.) | |
ToObjectConstruction |
Converts an IAnnotationValue into an ObjectConstruction.
(Defined by AnnotationValueExtensions.) |
Any MetadataDeclaration can have custom attributes. They are exposed on the CustomAttributes property.
If you change any member of an instance of CustomAttributeDeclaration, you have to call the InvalidateSerialization() to force the custom attribute to be serialized again.