2using System.Reflection;
19 base(context, type.ContainingModule, type, underlyingProperty)
21 _underlyingProperty = underlyingProperty ??
throw new ArgumentNullException(nameof(underlyingProperty));
27 internal PropertyInfo UnderlyingProperty => _underlyingProperty;
30 public PropertyAttributes
Attributes => _underlyingProperty.Attributes;
33 public bool CanRead => _underlyingProperty.CanRead;
36 public bool CanWrite => _underlyingProperty.CanWrite;
53 return _underlyingProperty.GetRawConstantValue();
59 return ResolveMethodSymbols(_underlyingProperty.GetAccessors());
65 return ResolveMethodSymbols(_underlyingProperty.GetAccessors(nonPublic));
71 return ResolveParameterSymbols(_underlyingProperty.GetIndexParameters());
77 return _underlyingProperty.GetGetMethod() is
MethodInfo m ? ResolveMethodSymbol(m) :
null;
83 return _underlyingProperty.GetGetMethod(nonPublic) is
MethodInfo m ? ResolveMethodSymbol(m) :
null;
89 return _underlyingProperty.GetSetMethod() is
MethodInfo m ? ResolveMethodSymbol(m) :
null;
95 return _underlyingProperty.GetSetMethod(nonPublic) is
MethodInfo m ? ResolveMethodSymbol(m) :
null;
101 throw new NotImplementedException();
107 return ResolveTypeSymbols(_underlyingProperty.GetOptionalCustomModifiers());
113 return ResolveTypeSymbols(_underlyingProperty.GetRequiredCustomModifiers());
IKVM.Reflection.PropertyInfo PropertyInfo
IKVM.Reflection.MethodInfo MethodInfo
Obtains information about the attributes of a member and provides access to member metadata.
ITypeSymbol[] GetOptionalCustomModifiers()
Returns an array of types representing the optional custom modifiers of the property.
IMethodSymbol? GetGetMethod(bool nonPublic)
When overridden in a derived class, returns the public or non-public get accessor for this property.
PropertyAttributes Attributes
Gets the attributes for this property.
IMethodSymbol? GetSetMethod()
Returns the public set accessor for this property.
IMethodSymbol? GetSetMethod(bool nonPublic)
When overridden in a derived class, returns the set accessor for this property.
ITypeSymbol PropertyType
Gets the type of this property.
ITypeSymbol GetModifiedPropertyType()
Gets the modified type of this property object.
ReflectionPropertySymbol(ReflectionSymbolContext context, ReflectionTypeSymbol type, PropertyInfo underlyingProperty)
Initializes a new instance.
ITypeSymbol[] GetRequiredCustomModifiers()
Returns an array of types representing the required custom modifiers of the property.
bool CanRead
Gets a value indicating whether the property can be read.
object? GetRawConstantValue()
Returns a literal value associated with the property by a compiler.
bool CanWrite
Gets a value indicating whether the property can be written to.
IMethodSymbol[] GetAccessors()
Returns an array whose elements reflect the public get and set accessors of the property reflected by...
IMethodSymbol? GetMethod
Gets the get accessor for this property.
IMethodSymbol[] GetAccessors(bool nonPublic)
Returns an array whose elements reflect the public and, if specified, non-public get and set accessor...
bool IsSpecialName
Gets a value indicating whether the property is the special name.
IMethodSymbol? GetGetMethod()
Returns the public get accessor for this property.
IMethodSymbol? SetMethod
Gets the set accessor for this property.
IParameterSymbol[] GetIndexParameters()
When overridden in a derived class, returns an array of all the index parameters for the property.
Holds references to symbols derived from System.Reflection.
Discovers the attributes of a method and provides access to method metadata.
Discovers the attributes of a parameter and provides access to parameter metadata.
Discovers the attributes of a property and provides access to property metadata.
Represents type declarations: class types, interface types, array types, value types,...