PostSharp SDK6.6//Post­Sharp.​Sdk.​Code­Model Namespace/Field­Def­Declaration Class

FieldDefDeclaration Class

Represents a field definition (FieldDef).
Inheritance Hierarchy

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.6.3.0 (6.6.3.0)
Syntax
C#
public sealed class FieldDefDeclaration : NamedPositionedMetadataDeclaration, 
	IField, IMember, IMetadataDeclaration, IDeclaration, IElement, 
	IModuleElement, ITaggable, IWriteReflectionName, INamed, IRemovable

The FieldDefDeclaration type exposes the following members.

Constructors
  NameDescription
Public methodFieldDefDeclaration
Initializes a new instance of the FieldDefDeclaration class
Properties
  NameDescription
Public propertyAttributes
Gets or sets the field attributes.
Public propertyCustomDebuggingInformation (Inherited from Declaration.)
Public propertyDeclaringType
Gets the type declaring the current field.
Public propertyFieldType
Gets or set the field type.
Public propertyInitialValue
Gets or sets the DataSectionDeclaration used to initialize the field.
Public propertyIsConst
Determines whether the field is constant (i.e. literal).
Public propertyIsOriginal
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.)
Public propertyIsReadOnly
Determines whether the field is read-only (i.e. init only).
Public propertyIsStatic
Determines whether the current member is static.
Public propertyLiteralValue
Gets the value of the literal field.
Public propertyMarshalType
Gets or sets the MarshalType of the field.
Public propertyMetadataToken
Gets or sets the token of the current declaration.
(Inherited from MetadataDeclaration.)
Public propertyName
Gets or sets the name of the current declaration.
(Inherited from NamedMetadataDeclaration.)
Public propertyOffset
Gets or sets the offset of the current field in the type layout.
Public propertyOrdinal (Inherited from NamedPositionedMetadataDeclaration.)
Public propertyOriginalDeclaration
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.)
Public propertyOriginalName (Inherited from NamedMetadataDeclaration.)
Public propertyParentMember
Gets the parent member of the current declaration.
(Overrides MetadataDeclaration.ParentMember.)
Public propertyParentType
Gets the parent type of the current declaration.
(Overrides MetadataDeclaration.ParentType.)
Public propertyVisibility
Gets the field visibility.
Methods
  NameDescription
Public methodClearCache
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.)
Public methodDispose Obsolete. (Inherited from MetadataDeclaration.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetGenericContext
Gets the generic context of the declaring type.
Public methodGetGenericInstance
Gets a generic instance of the current field.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetSystemField
Gets the system runtime field corresponding to the current field.
Public methodGetTag<T>
Gets a tag associated with the current declaration.
(Inherited from MetadataDeclaration.)
Public methodGetTokenType
Gets the TokenType of the derived declaration.
(Overrides MetadataDeclaration.GetTokenType().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRemove
Remove the current declaration from its parent.
Public methodSetTag<T>
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.)
Public methodToString (Overrides NamedMetadataDeclaration.ToString().)
Public methodTranslate
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions)
Writes the name of the current declaration to a StringBuilder.
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper)
Writes the name of the current declaration to a StringBuilder and specifies a NameMapper.
Fields
  NameDescription
Public fieldStatic memberAutoOffset
When applied to the Offset value, indicates that the offset is determined by the runtime automatically.
Extension Methods
  NameDescription
Public Extension MethodGetCanonicalGenericInstance
Gets the canonical generic instance of a field.
(Defined by GenericHelper.)
Public Extension MethodGetDisplayName
Gets the name of a given declaration as it should be displayed to the user.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodGetReflectionName()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.)
Public Extension MethodGetReflectionName(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.)
Public Extension MethodGetReflectionName(ReflectionNameOptions, NameMapper)Overloaded.
Gets the name of a given declaration, constructed using given options.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodIsExternallyVisible
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsPublic()Overloaded.
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsPublic()Overloaded.
Determines whether a field is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsVisible
Determines whether a member is visible from a given scope.
(Defined by VisibilityHelper.)
Remarks
Fields are owned by a types (TypeDefDeclaration) on the Fields property.
See Also