Class EventMemberDescriptor
Class providing easier marshalling of CLR events. Handling is limited to a narrow range of handler signatures, which, however, covers in practice most of all available events.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class EventMemberDescriptor : IMemberDescriptor
Constructors
EventMemberDescriptor(EventInfo, InteropAccessMode)
Initializes a new instance of the EventMemberDescriptor class.
Declaration
public EventMemberDescriptor(EventInfo ei, InteropAccessMode accessMode = InteropAccessMode.Default)
Parameters
|
EventInfo
ei
The ei. |
|
InteropAccessMode
accessMode
The access mode. |
Fields
MAX_ARGS_IN_DELEGATE
The maximum number of arguments supported in an event handler delegate
Declaration
public const int MAX_ARGS_IN_DELEGATE = 16
Field Value
|
System.Int32
|
Properties
EventInfo
Gets the EventInfo object of the event described by this descriptor
Declaration
public EventInfo EventInfo { get; }
Property Value
|
EventInfo
|
IsStatic
Gets a value indicating whether the event described by this descriptor 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 member
Declaration
public string Name { get; }
Property Value
|
System.String
|
Methods
CheckEventIsCompatible(EventInfo, Boolean)
Checks if the event is compatible with a standard descriptor
Declaration
public static bool CheckEventIsCompatible(EventInfo ei, bool throwException)
Parameters
|
EventInfo
ei
The EventInfo. |
|
System.Boolean
throwException
if set to |
Returns
|
System.Boolean
|
Exceptions
|
System.ArgumentException
Thrown if throwException is |
GetValue(Script, Object)
Gets a dynvalue which is a facade supporting add/remove methods which is callable from scripts
Declaration
public DynValue GetValue(Script script, object obj)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object for which the facade should be written. |
Returns
|
DynValue
|
SetValue(Script, Object, DynValue)
Sets the value.
Declaration
public void SetValue(Script script, object obj, DynValue v)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object. |
|
DynValue
v
The v. |
TryCreateIfVisible(EventInfo, InteropAccessMode)
Tries to create a new StandardUserDataEventDescriptor, returning null in case the method is not
visible to script code.
Declaration
public static EventMemberDescriptor TryCreateIfVisible(EventInfo ei, InteropAccessMode accessMode)
Parameters
|
EventInfo
ei
The EventInfo. |
| InteropAccessMode accessMode |
Returns
|
EventMemberDescriptor
A new StandardUserDataEventDescriptor or null. |