Defines that no instances of the provided types (and optionally their subclasses) should exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

Namespace:  SciTech.NetMemProfiler
Assembly:  MemProfiler2 (in MemProfiler2.dll)

Syntax

C#
public void NoInstances(
	Type[] types,
	bool includeSubclasses
)
Visual Basic
Public Sub NoInstances ( _
	types As Type(), _
	includeSubclasses As Boolean _
)
Visual C++
public:
void NoInstances(
	array<Type^>^ types, 
	bool includeSubclasses
)

Parameters

types
Type: array<System..::..Type>[]()[][]
An array containing the Types that should be checked.
includeSubclasses
Type: System..::..Boolean
Indicates whether instances of subclasses of the specified type should be checked.

Remarks

Calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will fail if an instance of the provided types (and optionally their subclasses) exists, unless the type is also included in a call to an AllowXXX or MaxXXX method.

See Also