HandleCollector Class
Tracks outstanding handles and forces a garbage collection when the specified threshold is reached.
Assembly: System (in System.dll)
| Name | Description | |
|---|---|---|
![]() | HandleCollector(String, Int32) | Initializes a new instance of the HandleCollector class using a name and a threshold at which to begin handle collection. |
![]() | HandleCollector(String, Int32, Int32) | 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. |
| Name | Description | |
|---|---|---|
![]() | 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 | Gets the name of a HandleCollector object. |
| Name | Description | |
|---|---|---|
![]() | Add() | Increments the current handle count. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | Remove() | Decrements the current handle count. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The HandleCollector class keeps track of a limited number of handles to unmanaged resources. Typically, unmanaged resources include handles to HDCs, HWnds, and so on.
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

