Class RoslynPropertyInfo
Namespace: Neon.Roslyn
Assembly: Neon.Roslyn.dll
Syntax
public class RoslynPropertyInfo : PropertyInfo
Constructors
RoslynPropertyInfo(IPropertySymbol, MetadataLoadContext)
Declaration
public RoslynPropertyInfo(IPropertySymbol property, MetadataLoadContext metadataLoadContext)
Parameters
Type | Name | Description |
---|---|---|
IPropertySymbol | property | |
MetadataLoadContext | metadataLoadContext |
Properties
Attributes
Gets the attributes for this property.
Declaration
public override PropertyAttributes Attributes { get; }
Property Value
Type | Description |
---|---|
PropertyAttributes | The attributes of this property. |
Overrides
CanRead
Gets a value indicating whether the property can be read.
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
CanWrite
Gets a value indicating whether the property can be written to.
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
CustomAttributes
Gets a collection that contains this member's custom attributes.
Declaration
public override IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<CustomAttributeData> | A collection that contains this member's custom attributes. |
Overrides
DeclaringType
Gets the class that declares this member.
Declaration
public override Type DeclaringType { get; }
Property Value
Type | Description |
---|---|
Type | The |
Overrides
Name
Gets the name of the current member.
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
string | A string containing the name of this member. |
Overrides
PropertySymbol
Declaration
public IPropertySymbol PropertySymbol { get; }
Property Value
Type | Description |
---|---|
IPropertySymbol |
PropertyType
Gets the type of this property.
Declaration
public override Type PropertyType { get; }
Property Value
Type | Description |
---|---|
Type | The type of this property. |
Overrides
ReflectedType
Gets the class object that was used to obtain this instance of MemberInfo
.
Declaration
public override Type ReflectedType { get; }
Property Value
Type | Description |
---|---|
Type | The |
Overrides
Methods
GetAccessors(bool)
Returns an array whose elements reflect the public and, if specified, non-public get and set accessors of the property reflected by the current instance.
Declaration
public override MethodInfo[] GetAccessors(bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
bool | nonPublic | Indicates whether non-public methods should be returned in the returned array. true if non-public methods are to be included; otherwise, false. |
Returns
Type | Description |
---|---|
MethodInfo[] | An array whose elements reflect the get and set accessors of the property reflected by the current instance. If |
Overrides
GetCustomAttributes(bool)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
Declaration
public override object[] GetCustomAttributes(bool inherit)
Parameters
Type | Name | Description |
---|---|---|
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
object[] | An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. |
TypeLoadException | A custom attribute type could not be loaded. |
GetCustomAttributes(Type, bool)
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.
Declaration
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
object[] | An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to |
Overrides
Exceptions
Type | Condition |
---|---|
TypeLoadException | A custom attribute type cannot be loaded. |
ArgumentNullException | If |
InvalidOperationException | This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. |
GetGetMethod(bool)
When overridden in a derived class, returns the public or non-public get accessor for this property.
Declaration
public override MethodInfo GetGetMethod(bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
bool | nonPublic | Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false. |
Returns
Type | Description |
---|---|
MethodInfo | A |
Overrides
Exceptions
Type | Condition |
---|---|
SecurityException | The requested method is non-public and the caller does not have System.Security.Permissions.ReflectionPermission to reflect on this non-public method. |
GetIndexParameters()
When overridden in a derived class, returns an array of all the index parameters for the property.
Declaration
public override ParameterInfo[] GetIndexParameters()
Returns
Type | Description |
---|---|
ParameterInfo[] | An array of type |
Overrides
GetSetMethod(bool)
When overridden in a derived class, returns the set accessor for this property.
Declaration
public override MethodInfo GetSetMethod(bool nonPublic)
Parameters
Type | Name | Description |
---|---|---|
bool | nonPublic | Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false. |
Returns
Type | Description | ||||||
---|---|---|---|---|---|---|---|
MethodInfo | This property's
|
Overrides
Exceptions
Type | Condition |
---|---|
SecurityException | The requested method is non-public and the caller does not have System.Security.Permissions.ReflectionPermission to reflect on this non-public method. |
GetValue(object, BindingFlags, Binder, object[], CultureInfo)
When overridden in a derived class, returns the property value of a specified object that has the specified binding, index, and culture-specific information.
Declaration
public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object whose property value will be returned. |
BindingFlags | invokeAttr | A bitwise combination of the following enumeration members that specify the invocation attribute: |
Binder | binder | An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If |
object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |
CultureInfo | culture | The culture for which the resource is to be localized. If the resource is not localized for this culture, the Parent property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the CurrentUICulture property. |
Returns
Type | Description |
---|---|
object | The property value of the specified object. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentException | The -or- The property's get accessor is not found. |
TargetException | The object does not match the target type, or a property is an instance property but |
TargetParameterCountException | The number of parameters in |
MethodAccessException | There was an illegal attempt to access a private or protected method inside a class. |
TargetInvocationException | An error occurred while retrieving the property value. For example, an index value specified for an indexed property is out of range. The InnerException property indicates the reason for the error. |
IsDefined(Type, bool)
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.
Declaration
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
Type | attributeType | The type of custom attribute to search for. The search includes derived types. |
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
bool | true if one or more instances of |
Overrides
SetValue(object, object, BindingFlags, Binder, object[], CultureInfo)
When overridden in a derived class, sets the property value for a specified object that has the specified binding, index, and culture-specific information.
Declaration
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object whose property value will be set. |
object | value | The new property value. |
BindingFlags | invokeAttr | A bitwise combination of the following enumeration members that specify the invocation attribute: |
Binder | binder | An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If |
object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |
CultureInfo | culture | The culture for which the resource is to be localized. If the resource is not localized for this culture, the Parent property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the CurrentUICulture property. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentException | The -or- The property's set accessor is not found. -or-
|
TargetException | The object does not match the target type, or a property is an instance property but |
TargetParameterCountException | The number of parameters in |
MethodAccessException | There was an illegal attempt to access a private or protected method inside a class. |
TargetInvocationException | An error occurred while setting the property value. For example, an index value specified for an indexed property is out of range. The InnerException property indicates the reason for the error. |