Search Results for

    Show / Hide Table of Contents

    Method NoInstances

    NoInstances(Type)

    This NoInstances assertion accepts a single System.Type. Subclasses will not be checked.

    Declaration
    [Obsolete("Use MemProfiler.Assert with an AssertionsDefinition instead.")]
    public static bool NoInstances(Type type)
    Parameters
    Type Name Description
    System.Type type

    Identifies the System.Type of the instances to check.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified type, otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    NoInstances(Type, Boolean)

    This NoInstances assertion accepts a single System.Type and boolean parameter indicating whether subclasses should be included.

    Declaration
    public static bool NoInstances(Type type, bool includeSubClasses)
    Parameters
    Type Name Description
    System.Type type

    Identifies the base System.Type of the instances to check.

    System.Boolean includeSubClasses

    Indicates whether instances of subclasses of the specified type should also be checked.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified type (and optionally, of its subclasses), otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    NoInstances(String)

    This NoInstances assertion accepts a single type name. 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).

    Declaration
    public static bool NoInstances(string type)
    Parameters
    Type Name Description
    System.String type

    Identifies the type of the instances to check.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified type (and optionally, of its subclasses), otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    NoInstances(Type[])

    This NoInstances assertion accepts an array of System.Types to check. Subclasses will not be checked.

    Declaration
    public static bool NoInstances(Type[] types)
    Parameters
    Type Name Description
    System.Type[] types

    Identifies the System.Types of the instances to check.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified type, otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    NoInstances(Type[], Boolean)

    This NoInstances assertion accepts an array of System.Types to check and a boolean parameter indicating whether subclasses should be included.

    Declaration
    public static bool NoInstances(Type[] types, bool includeSubclasses)
    Parameters
    Type Name Description
    System.Type[] types

    Identifies the base System.Types of the instances to check.

    System.Boolean includeSubclasses

    Indicates whether instances of subclasses of the specified types should also be checked.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified types (and optionally, of their subclasses), otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    NoInstances(String[])

    This NoInstances assertion accepts an array of type names to check. The type names 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).

    Declaration
    public static bool NoInstances(string[] types)
    Parameters
    Type Name Description
    System.String[] types

    Identifies the System.Types of the instances to check.

    Returns
    Type Description
    System.Boolean

    If the process is being profiled, true is returned if no instances exists of the specified type, otherwise false will be returned.

    If this process is not being profiled, true will always be returned.

    In This Article
    Back to top

    © Copyright 2002-2020. SciTech Software AB.
    For information about .NET Memory Profiler, see the product site at https://memprofiler.com