HandleCollector 类

定义

跟踪未完成的句柄并在达到指定阈值时强制实施垃圾回收。Tracks outstanding handles and forces a garbage collection when the specified threshold is reached.

public ref class HandleCollector sealed
public sealed class HandleCollector
type HandleCollector = class
Public NotInheritable Class HandleCollector
继承
HandleCollector

注解

HandleCollector 类跟踪有限数量的非托管资源的句柄。The HandleCollector class keeps track of a limited number of handles to unmanaged resources. 通常,非托管资源包括对 HDCs、HWnds 等的句柄。Typically, unmanaged resources include handles to HDCs, HWnds, and so on.

构造函数

HandleCollector(String, Int32)

使用一个名称以及一个阈值(在达到该值时开始执行图柄回收)初始化 HandleCollector 类的新实例。Initializes a new instance of the HandleCollector class using a name and a threshold at which to begin handle collection.

HandleCollector(String, Int32, Int32)

使用一个名称、一个指定何时开始执行图柄回收的阈值,以及一个指定必须进行图柄回收的时间的阈值初始化 HandleCollector 类的新实例。Initializes a new instance of the HandleCollector class using a name, a threshold at which to begin handle collection, and a threshold at which handle collection must occur.

属性

Count

获取回收的图柄的数量。Gets the number of handles collected.

InitialThreshold

获取一个值,该值指定了何时开始执行回收。Gets a value that specifies the point at which collections should begin.

MaximumThreshold

获取指定必须开始进行回收的时间的值。Gets a value that specifies the point at which collections must occur.

Name

获取 HandleCollector 对象的名称。Gets the name of a HandleCollector object.

方法

Add()

增加当前图柄计数。Increments the current handle count.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Remove()

减少当前图柄计数。Decrements the current handle count.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于