Class PropertyMemberDescriptor
Class providing easier marshalling of CLR properties
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class PropertyMemberDescriptor : IMemberDescriptor, IOptimizableDescriptor, IWireableDescriptor
Constructors
PropertyMemberDescriptor(PropertyInfo, InteropAccessMode)
Initializes a new instance of the PropertyMemberDescriptor class. NOTE: This constructor gives get/set visibility based exclusively on the CLR visibility of the getter and setter methods.
Declaration
public PropertyMemberDescriptor(PropertyInfo pi, InteropAccessMode accessMode)
Parameters
|
PropertyInfo
pi
The pi. |
|
InteropAccessMode
accessMode
The access mode. |
PropertyMemberDescriptor(PropertyInfo, InteropAccessMode, MethodInfo, MethodInfo)
Initializes a new instance of the PropertyMemberDescriptor class.
Declaration
public PropertyMemberDescriptor(PropertyInfo pi, InteropAccessMode accessMode, MethodInfo getter, MethodInfo setter)
Parameters
|
PropertyInfo
pi
The PropertyInfo. |
| InteropAccessMode accessMode |
|
MethodInfo
getter
The getter method. Use null to make the property writeonly. |
|
MethodInfo
setter
The setter method. Use null to make the property readonly. |
Properties
AccessMode
Gets the InteropAccessMode
Declaration
public InteropAccessMode AccessMode { get; }
Property Value
|
InteropAccessMode
|
CanRead
Gets a value indicating whether this instance can be read from
Declaration
public bool CanRead { get; }
Property Value
|
System.Boolean
|
CanWrite
Gets a value indicating whether this instance can be written to.
Declaration
public bool CanWrite { get; }
Property Value
|
System.Boolean
|
IsStatic
Gets a value indicating whether the described property is static.
Declaration
public bool IsStatic { get; }
Property Value
|
System.Boolean
|
MemberAccess
Gets the types of access supported by this member
Declaration
public MemberDescriptorAccess MemberAccess { get; }
Property Value
|
MemberDescriptorAccess
|
Name
Gets the name of the property
Declaration
public string Name { get; }
Property Value
|
System.String
|
PropertyInfo
Gets the PropertyInfo got by reflection
Declaration
public PropertyInfo PropertyInfo { get; }
Property Value
|
PropertyInfo
|
Methods
GetValue(Script, Object)
Gets the value of the property
Declaration
public DynValue GetValue(Script script, object obj)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object. |
Returns
|
DynValue
|
PrepareForWiring(Table)
Prepares the descriptor for hard-wiring. The descriptor fills the passed table with all the needed data for hardwire generators to generate the appropriate code.
Declaration
public void PrepareForWiring(Table t)
Parameters
|
Table
t
The table to be filled |
SetValue(Script, Object, DynValue)
Sets the value of the property
Declaration
public void SetValue(Script script, object obj, DynValue v)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object. |
|
DynValue
v
The value to set. |
TryCreateIfVisible(PropertyInfo, InteropAccessMode)
Tries to create a new StandardUserDataPropertyDescriptor, returning null in case the property is not
visible to script code.
Declaration
public static PropertyMemberDescriptor TryCreateIfVisible(PropertyInfo pi, InteropAccessMode accessMode)
Parameters
|
PropertyInfo
pi
The PropertyInfo. |
| InteropAccessMode accessMode |
Returns
|
PropertyMemberDescriptor
A new StandardUserDataPropertyDescriptor or null. |