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.3
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.
Previous
Next