HandleCollector HandleCollector HandleCollector HandleCollector Class

定义

跟踪未完成的句柄并在达到指定阈值时强制实施垃圾回收。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
继承
HandleCollectorHandleCollectorHandleCollectorHandleCollector

注解

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(String, Int32) HandleCollector(String, Int32) 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(String, Int32, Int32) HandleCollector(String, Int32, Int32) 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 Count Count Count

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

InitialThreshold InitialThreshold InitialThreshold InitialThreshold

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

MaximumThreshold MaximumThreshold MaximumThreshold MaximumThreshold

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

Name Name Name Name

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

方法

Add() Add() Add() Add()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Remove() Remove() Remove() Remove()

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

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于