API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

DisposableToken Class

IDisposable delegate adapter.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.ModelDisposableToken

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.1
Syntax
public sealed class DisposableToken : IDisposable

The DisposableToken type exposes the following members.

Constructors
  NameDescription
Public methodDisposableToken
Initializes a new instance of the DisposableToken class.
Top
Methods
  NameDescription
Public methodDispose
Invokes the callback.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Combines the two disposable objects.
Top
Fields
  NameDescription
Public fieldStatic memberNone
The default instance that does nothing.
Top
Examples
IDisposable InitiateOperation()
{
    var token = Disposable.None;
    try
    {
        token += new Disposable(() => FinalizeOnePart());
        token += new Disposable(() => FinalizeOtherPart());
        return token;
    }
    catch
    {
        token.Dispose();
        throw;
    }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.