Click or drag to resize

DatabaseAddDocumentChangeListener Method (String, TaskScheduler, EventHandlerDocumentChangedEventArgs)

Adds a document change listener for the document with the given ID and the TaskScheduler that will be used to invoke the callback. If the scheduler is not specified, then the default scheduler will be used (scheduled via thread pool)

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0713
Syntax
C#
public ListenerToken AddDocumentChangeListener(
	string id,
	TaskScheduler scheduler,
	EventHandler<DocumentChangedEventArgs> handler
)

Parameters

id
Type: SystemString
The document ID
scheduler
Type: System.Threading.TasksTaskScheduler
The scheduler to use when firing the event handler
handler
Type: SystemEventHandlerDocumentChangedEventArgs
The logic to handle the event

Return Value

Type: ListenerToken
A ListenerToken that can be used to remove the listener later
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if handler or id is null
InvalidOperationExceptionThrown if this method is called after the database is closed
See Also