Partager via


PexDisposableContext Class

Definition

A disposable context to store disposable object that will dispose all objects safely.

public ref class PexDisposableContext sealed : IDisposable
[__Protect]
[System.Diagnostics.DebuggerDisplay("Count = {Count}")]
public sealed class PexDisposableContext : IDisposable
[<__Protect>]
[<System.Diagnostics.DebuggerDisplay("Count = {Count}")>]
type PexDisposableContext = class
    interface IDisposable
Public NotInheritable Class PexDisposableContext
Implements IDisposable
Inheritance
PexDisposableContext
Attributes
__ProtectAttribute DebuggerDisplayAttribute
Implements

Properties

Count

Gets the number of instances in the context. There might be aliasing.

IsEmpty

Gets the number of disposable instances in this context.

Methods

Add(IDisposable)

Adds the specified disposable (may be null).

Add(Object)

Adds the object to the context (may be null). If the object is a mole, attaches the mole and stores the context

Create()

Creates this instance.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Applies to