FieldElement Class

A field.

public sealed class FieldElement : MemberElement
Inheritance
MemberElement FieldElement

Properties

NameDescription
AccessibilityGets the declared accessibility of the member.
AttributesGets the attributes applied to the member.
IsConstantGets a value indicating whether the field is a constant (const, or a value of an enum).
IsReadOnlyGets a value indicating whether the field is readonly.
IsStaticGets a value indicating whether the member is static.
LocationGets null: a field has no code, so the PDB records no location for it.
TypeGets the type of the field.

Accessibility

FieldElement.cs

Gets the declared accessibility of the member.

public override ElementAccessibility Accessibility { get; }

Property value

ElementAccessibility

Attributes

FieldElement.cs

Gets the attributes applied to the member.

public override IReadOnlyList<AttributeElement> Attributes { get; }

IsConstant

FieldElement.cs

Gets a value indicating whether the field is a constant (const, or a value of an enum).

public bool IsConstant { get; }

Property value

bool

IsReadOnly

FieldElement.cs

Gets a value indicating whether the field is readonly.

public bool IsReadOnly { get; }

Property value

bool

Gets a value indicating whether the member is static.

public override bool IsStatic { get; }

Property value

bool

Gets null: a field has no code, so the PDB records no location for it.

public override SourceLocation? Location { get; }

Property value

SourceLocation?

Gets the type of the field.

public TypeReference Type { get; }

Property value

TypeReference