Skip to content

Class ReflectionObjectDescriptor

Definition

Namespace: StardewUI.Framework.Descriptors
Assembly: StardewUI.dll

Object descriptor based on reflection.

public class ReflectionObjectDescriptor : 
    StardewUI.Framework.Descriptors.IObjectDescriptor

Inheritance
Object ⇦ ReflectionObjectDescriptor

Implements
IObjectDescriptor

Members

Properties

Name Description
MemberNames Enumerates the names of all members of the object type.
SupportsChangeNotifications Whether or not objects of this type can notify about data changes; that is, if the type implements INotifyPropertyChanged.
TargetType The type being described, which owns or inherits each of the available members.

Methods

Name Description
TryGetEvent(string, IEventDescriptor) Attempts to retrieve a named event on the TargetType.
TryGetMethod(string, IMethodDescriptor) Attempts to retrieve a named method of the TargetType.
TryGetProperty(string, IPropertyDescriptor) Attempts to retrieve a named property of the TargetType.

Details

Properties

MemberNames

Enumerates the names of all members of the object type.

public System.Collections.Generic.IEnumerable<string> MemberNames { get; }
Property Value

IEnumerable<string>


SupportsChangeNotifications

Whether or not objects of this type can notify about data changes; that is, if the type implements INotifyPropertyChanged.

public bool SupportsChangeNotifications { get; }
Property Value

Boolean


TargetType

The type being described, which owns or inherits each of the available members.

public System.Type TargetType { get; }
Property Value

Type


Methods

TryGetEvent(string, IEventDescriptor)

Attempts to retrieve a named event on the TargetType.

public bool TryGetEvent(string name, out StardewUI.Framework.Descriptors.IEventDescriptor event);
Parameters

name   string
The event name.

event   IEventDescriptor
When this method returns, holds a reference to the IEventDescriptor whose Name is name, or null if no event was found with the given name.

Returns

Boolean

true if the named event was found, otherwise false.


TryGetMethod(string, IMethodDescriptor)

Attempts to retrieve a named method of the TargetType.

public bool TryGetMethod(string name, out StardewUI.Framework.Descriptors.IMethodDescriptor method);
Parameters

name   string
The method name.

method   IMethodDescriptor
When this method returns, holds a reference to the IMethodDescriptor whose Name is name, or null if no method was found with the given name.

Returns

Boolean

true if the named method was found, otherwise false.

Remarks

Overloaded methods are not supported. If different signatures are required, use optional parameters.


TryGetProperty(string, IPropertyDescriptor)

Attempts to retrieve a named property of the TargetType.

public bool TryGetProperty(string name, out StardewUI.Framework.Descriptors.IPropertyDescriptor property);
Parameters

name   string
The property name.

property   IPropertyDescriptor
When this method returns, holds a reference to the IPropertyDescriptor whose Name is name, or null if no property was found with the given name.

Returns

Boolean

true if the named property was found, otherwise false.