Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
MobileDevice Class
MobileDevice Events
 Hibernate Event

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.Net Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
MobileDevice.Hibernate Event

Provides access to the WM_HIBERNATE message in Windows CE.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Visual Basic (Declaration)
Public Shared Event Hibernate As EventHandler
Visual Basic (Usage)
Dim handler As EventHandler

AddHandler MobileDevice.Hibernate, handler
C#
public static event EventHandler Hibernate
C++
public:
static event EventHandler^ Hibernate {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
J#
/** @event */
public static void add_Hibernate (EventHandler value)

/** @event */
public static void remove_Hibernate (EventHandler value)
JScript
JScript supports the use of events, but not the declaration of new ones.

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.

The following code example shows how to add and use an event handler for the Hibernate event.

Visual Basic
' Connect an event handler, 
' OnHibernate, to the Hibernate event.
AddHandler MobileDevice.Hibernate, AddressOf OnHibernate
C#
// Connect an event hander, OnHibernate, to the Hibernate event.
MobileDevice.Hibernate += new EventHandler(OnHibernate);
Visual Basic
' 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
C#
private void OnHibernate(object sender, EventArgs e)
{
   // Add code here to release cached resources
   // for relieving memory pressure.
 
}
  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

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

.NET Compact Framework

Supported in: 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker