Disposer

Description

sealed class Tinman.Core.System.Disposer

Derived from

Disposable abstract

A Disposer is a container that holds zero or more IDisposable objects, which are disposed when the Disposer itself is disposed.

The IDisposable objects will be disposed in the same order as they have been added to the Disposer via Add(…​).

Public / Methods

Add


public method Add → (1)

disposable in : IDisposable

[not-null]
The object to add.

Adds an IDisposable object to this disposer.

The given disposable in object will be added to the list of objects to dispose. If the given disposable in object has already been added to this disposer, it will be moved to the end of the list (this can be used to ensure proper order of disposal, if necessary). In any case, exactly one strong reference to disposable in is kept by this Disposer object, until it gets disposed itself.