Events Class

The Events class allows the user to register event listeners for drawing events.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Drawing
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
public sealed class Events : MarshalByRefObject, 

The Events type exposes the following members.

Public methodEvents
Constructs a new instance of Events.
Public methodInitializeLifetimeService
Initializes the lifetime service.
(Overrides MarshalByRefObjectInitializeLifetimeService.)
Public methodRegister
Registers the instance to listen to the specified events.
Public methodUnRegister
Unregisters the instance from listening to events.
Public eventDrawingChanged
The DrawingChanged event is raised when the drawing has been changed and the database is committed.
Public eventDrawingDeleted
The DrawingDeleted event is raised when a drawing has been deleted.
Public eventDrawingInserted
The DrawingInserted event is raised when a drawing has been inserted.
Public eventDrawingReadyForIssuingChange
The DrawingReadyForIssuingChange event is raised just after a drawing is marked or unmarked ready for issuing.
Public eventDrawingStatusChanged
The DrawingStatusChanged event is raised when the drawing status has changed.
Public eventDrawingUpdated
The DrawingUpdated event is raised when the drawing has been inserted, deleted or modified, and the database is committed.
Asynchronous event handling

Registered event handlers are called asynchronously so that many handlers may be running simultaneously. Event handlers are not guaranteed to be run in the same thread where they were registered. The asynchronous nature of the events requires the use of synchronization constructs on objects and data structures that are not defined to be thread safe.

  • Microsoft's documentation about the lock statement:
  • Microsoft's documentation about delegates:
  • Microsoft's documentation about managed threading:
The following example shows how to make sure that only one selection event handler is running at a time.
using Tekla.Structures.Drawing;

   public class Example
       private Events _events = new Events();
       private object _statusChangedEventHandlerLock = new object();

       public void RegisterEventHandler()
           _events.DrawingStatusChanged += Events_DrawingStatusChangedEvent;

       public void UnRegisterEventHandler()

       void Events_DrawingStatusChangedEvent()
           /* Make sure that the inner code block is running synchronously */
               System.Console.WriteLine("Selection changed event received.");
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.