MobileDevice.Hibernate Event
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Provides access to the WM_HIBERNATE message in Windows CE.
Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)
Syntax
'Declaration
Public Shared Event Hibernate As EventHandler
'Usage
Dim handler As EventHandler
AddHandler MobileDevice.Hibernate, handler
public static event EventHandler Hibernate
public:
static event EventHandler^ Hibernate {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
member Hibernate : IEvent<EventHandler,
EventArgs>
Remarks
When memory pressure from running applications is intensive, Windows CE sends the WM_HIBERNATE message to top level windows. You can respond to this event in managed code with the Hibernate event.
You can provide code in an event handler to reduce resource usage to accommodate memory pressure from other applications running on the device. This event is specific only to the current thread.
Examples
The following code example shows how to add and use an event handler for the Hibernate event.
' Connect an event handler,
' OnHibernate, to the Hibernate event.
AddHandler MobileDevice.Hibernate, AddressOf OnHibernate
// Connect an event hander, OnHibernate, to the Hibernate event.
MobileDevice.Hibernate += new EventHandler(OnHibernate);
' Respond to the Hibernate event.
Private Sub OnHibernate(sender As Object, e As EventArgs)
' Add code here to release cached resources
' for relieving memory pressure.
End Sub
private void OnHibernate(object sender, EventArgs e)
{
// Add code here to release cached resources
// for relieving memory pressure.
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Compact Framework
Supported in: 3.5, 2.0