An object which manages a collection of disposable items.

Hierarchy (view full)

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

_isDisposed: boolean = false
_items: Set<IDisposable> = ...

Accessors

Methods

  • Add a disposable item to the set.

    Parameters

    • item: IDisposable

      The item to add to the set.

      Notes

      If the item is already contained in the set, this is a no-op.

    Returns void

  • Remove all items from the set.

    Returns void

  • Test whether the set contains a specific item.

    Parameters

    Returns boolean

    true if the set contains the item, false otherwise.

  • Dispose of the set and the items it contains.

    Notes

    Items are disposed in the order they are added to the set.

    Returns void

  • Remove a disposable item from the set.

    Parameters

    • item: IDisposable

      The item to remove from the set.

      Notes

      If the item is not contained in the set, this is a no-op.

    Returns void