C# Class Microsoft.Scripting.ComInterop.ComEventSink

This class implements an event sink for a particular RCW. Unlike the implementation of events in TlbImp'd assemblies, we will create only one event sink per RCW (theoretically RCW might have several ComEventSink evenk sinks - but all these implement different source intefaces). Each ComEventSink contains a list of ComEventSinkMethod objects - which represent a single method on the source interface an a multicast delegate to redirect the calls. Notice that we are chaining multicast delegates so that same ComEventSinkMedhod can invoke multiple event handlers). ComEventSink implements an IDisposable pattern to Unadvise from the connection point. Typically, when RCW is finalized the corresponding Dispose will be triggered by ComEventSinksContainer finalizer. Notice that lifetime of ComEventSinksContainer is bound to the lifetime of the RCW.
Inheritance: System.MarshalByRefObject, IReflect, IDisposable
显示文件 Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
AddHandler ( int dispid, object func ) : void
Dispose ( ) : void
ExecuteHandler ( string name, object args ) : object
FromRuntimeCallableWrapper ( object rcw, System.Guid sourceIid, bool createIfNotFound ) : ComEventSink
GetField ( string name, BindingFlags bindingAttr ) : FieldInfo
GetFields ( BindingFlags bindingAttr ) : System.Reflection.FieldInfo[]
GetMember ( string name, BindingFlags bindingAttr ) : MemberInfo[]
GetMembers ( BindingFlags bindingAttr ) : MemberInfo[]
GetMethod ( string name, BindingFlags bindingAttr ) : MethodInfo
GetMethod ( string name, BindingFlags bindingAttr, Binder binder, Type types, ParameterModifier modifiers ) : MethodInfo
GetMethods ( BindingFlags bindingAttr ) : System.Reflection.MethodInfo[]
GetProperties ( BindingFlags bindingAttr ) : System.Reflection.PropertyInfo[]
GetProperty ( string name, BindingFlags bindingAttr ) : PropertyInfo
GetProperty ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo
InvokeMember ( string name, BindingFlags invokeAttr, Binder binder, object target, object args, ParameterModifier modifiers, CultureInfo culture, string namedParameters ) : object
RemoveHandler ( int dispid, object func ) : void

Private Methods

Method Description
ComEventSink ( object rcw, System.Guid sourceIid ) : System
DisposeAll ( ) : void
FindSinkMethod ( string name ) : ComEventSinkMethod
Initialize ( object rcw, System.Guid sourceIid ) : void

Method Details

AddHandler() public method

public AddHandler ( int dispid, object func ) : void
dispid int
func object
return void

Dispose() public method

public Dispose ( ) : void
return void

ExecuteHandler() public method

public ExecuteHandler ( string name, object args ) : object
name string
args object
return object

FromRuntimeCallableWrapper() public static method

public static FromRuntimeCallableWrapper ( object rcw, System.Guid sourceIid, bool createIfNotFound ) : ComEventSink
rcw object
sourceIid System.Guid
createIfNotFound bool
return ComEventSink

GetField() public method

public GetField ( string name, BindingFlags bindingAttr ) : FieldInfo
name string
bindingAttr BindingFlags
return System.Reflection.FieldInfo

GetFields() public method

public GetFields ( BindingFlags bindingAttr ) : System.Reflection.FieldInfo[]
bindingAttr BindingFlags
return System.Reflection.FieldInfo[]

GetMember() public method

public GetMember ( string name, BindingFlags bindingAttr ) : MemberInfo[]
name string
bindingAttr BindingFlags
return MemberInfo[]

GetMembers() public method

public GetMembers ( BindingFlags bindingAttr ) : MemberInfo[]
bindingAttr BindingFlags
return MemberInfo[]

GetMethod() public method

public GetMethod ( string name, BindingFlags bindingAttr ) : MethodInfo
name string
bindingAttr BindingFlags
return System.Reflection.MethodInfo

GetMethod() public method

public GetMethod ( string name, BindingFlags bindingAttr, Binder binder, Type types, ParameterModifier modifiers ) : MethodInfo
name string
bindingAttr BindingFlags
binder System.Reflection.Binder
types System.Type
modifiers System.Reflection.ParameterModifier
return System.Reflection.MethodInfo

GetMethods() public method

public GetMethods ( BindingFlags bindingAttr ) : System.Reflection.MethodInfo[]
bindingAttr BindingFlags
return System.Reflection.MethodInfo[]

GetProperties() public method

public GetProperties ( BindingFlags bindingAttr ) : System.Reflection.PropertyInfo[]
bindingAttr BindingFlags
return System.Reflection.PropertyInfo[]

GetProperty() public method

public GetProperty ( string name, BindingFlags bindingAttr ) : PropertyInfo
name string
bindingAttr BindingFlags
return System.Reflection.PropertyInfo

GetProperty() public method

public GetProperty ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo
name string
bindingAttr BindingFlags
binder System.Reflection.Binder
returnType System.Type
types System.Type
modifiers System.Reflection.ParameterModifier
return System.Reflection.PropertyInfo

InvokeMember() public method

public InvokeMember ( string name, BindingFlags invokeAttr, Binder binder, object target, object args, ParameterModifier modifiers, CultureInfo culture, string namedParameters ) : object
name string
invokeAttr BindingFlags
binder System.Reflection.Binder
target object
args object
modifiers System.Reflection.ParameterModifier
culture System.Globalization.CultureInfo
namedParameters string
return object

RemoveHandler() public method

public RemoveHandler ( int dispid, object func ) : void
dispid int
func object
return void