FieldDefDeclaration Class |
Represents a field definition (FieldDef).
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.FieldDefDeclaration
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.NamedPositionedMetadataDeclaration
PostSharp.Sdk.CodeModel.FieldDefDeclaration
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 FieldDefDeclaration : NamedPositionedMetadataDeclaration, IField, IMember, IMetadataDeclaration, IDeclaration, IElement, IModuleElement, ITaggable, IWriteReflectionName, INamed, IRemovable
The FieldDefDeclaration type exposes the following members.
Name | Description | |
---|---|---|
FieldDefDeclaration | Initializes a new instance of the FieldDefDeclaration class |
Name | Description | |
---|---|---|
Attributes |
Gets or sets the field attributes.
| |
CustomDebuggingInformation | (Inherited from Declaration.) | |
DeclaringType |
Gets the type declaring the current field.
| |
FieldType |
Gets or set the field type.
| |
InitialValue |
Gets or sets the DataSectionDeclaration used to initialize
the field.
| |
IsConst |
Determines whether the field is constant (i.e. literal).
| |
IsOriginal |
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.) | |
IsReadOnly |
Determines whether the field is read-only (i.e. init only).
| |
IsStatic |
Determines whether the current member is static.
| |
LiteralValue |
Gets the value of the literal field.
| |
MarshalType |
Gets or sets the MarshalType of the field.
| |
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.) | |
Offset |
Gets or sets the offset of the current field in the type layout.
| |
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.
(Overrides MetadataDeclaration.ParentMember.) | |
ParentType |
Gets the parent type of the current declaration.
(Overrides MetadataDeclaration.ParentType.) | |
Visibility |
Gets the field visibility.
|
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.) | |
Dispose | Obsolete. (Inherited from MetadataDeclaration.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetGenericContext |
Gets the generic context of the declaring type.
| |
GetGenericInstance |
Gets a generic instance of the current field.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetSystemField |
Gets the system runtime field corresponding to the current field.
| |
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 | (Overrides NamedMetadataDeclaration.ToString().) | |
Translate | ||
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.
|
Name | Description | |
---|---|---|
AutoOffset |
When applied to the Offset value,
indicates that the offset is determined by the runtime
automatically.
|
Name | Description | |
---|---|---|
GetCanonicalGenericInstance |
Gets the canonical generic instance of a field.
(Defined by GenericHelper.) | |
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.) | |
IsExternallyVisible |
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsPublic() | Overloaded.
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsPublic() | Overloaded.
Determines whether a field is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsVisible |
Determines whether a member is visible from a given scope.
(Defined by VisibilityHelper.) |
Fields are owned by a types (TypeDefDeclaration) on the
Fields property.