Export (0) Print
Expand All

SafeHandle.IsClosed Property

Note: This property is new in the .NET Framework version 2.0.

Gets a value indicating whether the handle is closed.

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)

'Declaration
Public ReadOnly Property IsClosed As Boolean
'Usage
Dim instance As SafeHandle
Dim value As Boolean

value = instance.IsClosed

/** @property */
public boolean get_IsClosed ()

public function get IsClosed () : boolean

Property Value

true if the handle is closed; otherwise, false.

The IsClosed method returns a value indicating whether the SafeHandle object's handle is no longer associated with a native resource. This differs from the definition of the IsInvalid property, which computes whether a given handle is always considered invalid. The IsClosed method returns a true value in the following cases:

  • The SetHandleAsInvalid method was called.

  • The Dispose method or Close method was called and there are no references to the SafeHandle object on other threads.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft