Click or drag to resize

EventWatcher Class

An instance-based watcher for document and object events that can be notified for headless documents.

The static events on RhinoDoc are never raised for headless documents (a headless document is one created with CreateHeadless(String) or OpenHeadless(String), as used by Rhino.Inside and Rhino.Compute). Create an EventWatcher with includeHeadlessDocuments set to true to receive events for those documents as well.

IMPORTANT: When watching headless documents, events may be raised on a thread other than the main/UI thread, because headless documents can be created and read on background threads. Handlers must be thread-safe and must not assume they are running on the UI thread.

Call Dispose when the watcher is no longer needed to stop receiving events and release the underlying native watcher.

Inheritance Hierarchy
SystemObject
  RhinoEventWatcher

Namespace:  Rhino
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public class EventWatcher : IDisposable

The EventWatcher type exposes the following members.

Constructors
  NameDescription
Public methodEventWatcher
Creates a new event watcher and begins watching.
Top
Properties
  NameDescription
Public propertyIncludeHeadlessDocuments
Gets whether this watcher also receives events for headless documents.
Top
Methods
  NameDescription
Public methodDispose
Stops watching and releases the underlying native watcher.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventAddRhinoObject
Raised when a new object is added to a document.
Public eventBeginOpenDocument
Raised when a document open operation begins.
Public eventCloseDocument
Raised when a document is closed.
Public eventDeleteRhinoObject
Raised when an object is deleted from a document.
Public eventEndOpenDocument
Raised when a document open operation ends.
Public eventNewDocument
Raised when a new document is created.
Public eventPurgeRhinoObject
Raised when an object is purged from a document.
Public eventReplaceRhinoObject
Raised when an object is about to be replaced.
Public eventUndeleteRhinoObject
Raised when a previously deleted object is un-deleted.
Top
See Also