PropertyElement Class

A property or an indexer.

public sealed class PropertyElement : MemberElement
Inheritance
MemberElement PropertyElement

Properties

NameDescription
AccessibilityGets the most permissive accessibility of the accessors.
AttributesGets the attributes applied to the member.
GetterGets the get accessor, or null.
IsInitOnlyGets a value indicating whether the setter is an init accessor.
IsRequiredGets a value indicating whether the property is required.
IsStaticGets a value indicating whether the member is static.
LocationGets the first statement of the member when the PDB is available, or null.
SetterGets the set or init accessor, or null.
TypeGets the type of the property.

Accessibility

PropertyElement.cs

Gets the most permissive accessibility of the accessors.

public override ElementAccessibility Accessibility { get; }

Property value

ElementAccessibility

Gets the attributes applied to the member.

public override IReadOnlyList<AttributeElement> Attributes { get; }

Gets the get accessor, or null.

public MethodElement? Getter { get; }

Property value

MethodElement?

Gets a value indicating whether the setter is an init accessor.

public bool IsInitOnly { get; }

Property value

bool

Gets a value indicating whether the property is required.

public bool IsRequired { get; }

Property value

bool

Gets a value indicating whether the member is static.

public override bool IsStatic { get; }

Property value

bool

Gets the first statement of the member when the PDB is available, or null.

public override SourceLocation? Location { get; }

Property value

SourceLocation?

Gets the set or init accessor, or null.

public MethodElement? Setter { get; }

Property value

MethodElement?

Gets the type of the property.

public TypeReference Type { get; }

Property value

TypeReference