Method NoNewInstancesExcept
NoNewInstancesExcept(Type)
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of the specified System.Type.
Declaration
public static bool NoNewInstancesExcept(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | All new instances must be an instance of the Type specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type, Boolean)
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of the specified System.Type, or optionally one of its subclasses.
Declaration
public static bool NoNewInstancesExcept(Type type, bool includeSubclasses)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | All new instances must be an instance of the Type, or optionally one of its subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified type should also be allowed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type, Boolean, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of the specified System.Type, or optionally one of its subclasses. Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(Type type, bool includeSubclasses, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | All new instances must be an instance of the Type, or optionally one of its subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified type should also be allowed. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last
call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances
of the specified System.Type.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(Type type, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | All new instances must be an instance of the Type specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(String)
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of the specified type with the specified name.
Declaration
public static bool NoNewInstancesExcept(string type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | type | All new instances must be an instance of the type specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(String, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last
call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances
of the type with the specified name.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(string type, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | type | All new instances must be an instance of the type specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(Type[])
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of one of the specified System.Types.
Declaration
public static bool NoNewInstancesExcept(Type[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | All new instances must be an instance of one the Types specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type[], Boolean)
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of one of the specified System.Types, or optionally one of their subclasses.
Declaration
public static bool NoNewInstancesExcept(Type[] types, bool includeSubclasses)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | All new instances must be an instance of one of the Types, or optionally one of their subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should also be allowed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type[], Boolean, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last
call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances
of one of the specified System.Types, or optionally one of their subclasses.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(Type[] types, bool includeSubclasses, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | All new instances must be an instance of one of the Types, or optionally one of their subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should also be allowed. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(Type[], AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last
call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances
of one of the specified System.Types.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(Type[] types, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type[] | types | All new instances must be an instance of one the Types specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(String[])
This NoNewInstances method will assert that the only new live instances, created since the last call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances of one of the types with the specified names.
Declaration
public static bool NoNewInstancesExcept(string[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | types | All new instances must be an instance of one the Types specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(String[], AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the last
call to MemProfiler.FastSnapshot or MemProfiler.FullSnapshot, are instances
of one of the types with the specified names.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(string[] types, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | types | All new instances must be an instance of one the types specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(MemSnapshot, Type)
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of the specified System.Type.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type | type | All new instances must be an instance of the Type specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type, Boolean)
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of the specified System.Type, or optionally one of its subclasses.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type type, bool includeSubclasses)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type | type | All new instances must be an instance of the Type, or optionally one of its subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified type should also be allowed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type, Boolean, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of the specified System.Type, or optionally one of its subclasses. Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type type, bool includeSubClasses, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type | type | All new instances must be an instance of the Type, or optionally one of its subclasses, specified by this argument. |
| System.Boolean | includeSubClasses | Indicates whether instances of subclasses of the specified type should also be allowed. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison
snapshot, are instances
of the specified System.Type.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type type, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type | type | All new instances must be an instance of the Type specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, String)
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of the type with the specified name.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, string type)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.String | type | All new instances must be an instance of the type specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(MemSnapshot, String, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison
snapshot, are instances
of the type with the specified name.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, string type, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.String | type | All new instances must be an instance of the Type specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(MemSnapshot, Type[])
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of one of the specified System.Types.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type[] | types | All new instances must be an instance of one the Types specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type[], Boolean)
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of one of the specified System.Types, or optionally one of their subclasses.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type[] types, bool includeSubclasses)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type[] | types | All new instances must be an instance of one of the Types, or optionally one of their subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should also be allowed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type[], Boolean, AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison
snapshot, are instances
of one of the specified System.Types, or optionally one of their subclasses.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type[] types, bool includeSubclasses, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type[] | types | All new instances must be an instance of one of the Types, or optionally one of their subclasses, specified by this argument. |
| System.Boolean | includeSubclasses | Indicates whether instances of subclasses of the specified types should also be allowed. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, Type[], AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison
snapshot, are instances
of one of the specified System.Types.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, Type[] types, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.Type[] | types | All new instances must be an instance of one the Types specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
NoNewInstancesExcept(MemSnapshot, String[])
This NoNewInstances method will assert that the only new live instances, created since the comparison snapshot, are instances of one of the types with specified names.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, string[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.String[] | types | All new instances must be an instance of one the types specified by this argument. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).
NoNewInstancesExcept(MemSnapshot, String[], AssertionsThread)
This NoNewInstances method will assert that the only new live instances, created since the comparison
snapshot, are instances
of one of the types with the specified names.
Depending on the assertionsThread parameter, all new instances or only instances created by the calling thread, will be checked.
Declaration
public static bool NoNewInstancesExcept(MemSnapshot comparisonSnapshot, string[] types, AssertionsThread assertionsThread)
Parameters
| Type | Name | Description |
|---|---|---|
| MemSnapshot | comparisonSnapshot | Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances. |
| System.String[] | types | All new instances must be an instance of one the types specified by this argument. |
| AssertionsThread | assertionsThread | Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | If the current process is being profiled,
If the current process is not being profiled, no assertion is performed and |
Remarks
The type name can end with a '' to allow all types starting with a common string to be matched. This can be used to include all types in a namespace (e.g. "System.Windows.Forms." will include all types in the System.Windows.Forms namespace).