Επεξεργασία

Κοινή χρήση μέσω


WeakEventManager.StartListening(Object) Method

Definition

When overridden in a derived class, starts listening for the event being managed. After the StartListening(Object) method is first called, the manager should be in the state of calling DeliverEvent(Object, EventArgs) or DeliverEventToList(Object, EventArgs, WeakEventManager+ListenerList) whenever the relevant event from the provided source is handled.

protected:
 abstract void StartListening(System::Object ^ source);
protected abstract void StartListening (object source);
abstract member StartListening : obj -> unit
Protected MustOverride Sub StartListening (source As Object)

Parameters

source
Object

The source to begin listening on.

Notes to Implementers

StartListening(Object) overrides should add a handler to the provided source. The handler is declared by the manager itself. The class handler should not be public, and it should only be called in response to the event being managed. The class handler should call the DeliverEvent(Object, EventArgs) method or the DeliverEventToList(Object, EventArgs, WeakEventManager+ListenerList) method appropriately.

Applies to

See also