Tekla Open API

Detailed and full API reference helps you master Tekla Open API

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: 2018.1.0.0 (2018.1.0.0)
Syntax
public sealed class DisposableToken : IDisposable

The DisposableToken type exposes the following members.

Constructors
  Name Description
Public method DisposableToken
Initializes a new instance of the DisposableToken class.
Top
Methods
  Name Description
Public method Dispose
Invokes the callback.
Top
Operators
  Name Description
Public operatorStatic member Addition
Combines the two disposable objects.
Top
Fields
  Name Description
Public fieldStatic member None
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