Open sandboxFocus

Interface IFieldOrProperty

A base interface for IField and IProperty.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
public interface IFieldOrProperty : IFieldOrPropertyOrIndexer, IHasAccessors, IMember, IMemberOrNamedType, INamedDeclaration, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>, IFieldOrPropertyInvoker, IExpression, IHasType

Properties

Name Description
InitializerExpression

Gets the initializer expression (i.e. the expression at the right hand of the equal sign), if any. When the field or property is defined in source code, this property returns an ISourceExpression, which exposes a TypedConstant when possible.

IsAutoPropertyOrField

Gets a value indicating whether the declaration is an auto-property or a field, or null if the implementation of the property cannot be determined, for instance for properties in a referenced assembly.

IsRequired

Gets a value indicating whether the field or property is required, i.e. it must be initialized when an instance of the declaring type is initialized.

Methods

Name Description
ToFieldOrPropertyInfo()

Gets a FieldOrPropertyInfo that represents the current field or property at run time.

ToRef()

Extension Methods