PC Review


Reply
Thread Tools Rate Thread

Disable SystemState

 
 
jp2msft
Guest
Posts: n/a
 
      30th Apr 2009
Subject: Disable SystemState
Environment: Visual Studio 2005, C#
Target: Windows Mobile 5

I have a static string defined in my application that consists of a GUID
generated by VS2005.

When my Windows Mobile application launches, I initialize my code's
BatteryLevel state:

batteryLevel = new SystemState(SystemProperty.PowerBatteryStrength);
batteryLevel.Changed += new ChangeEventHandler(ChangeOccurred);

Next, I check to see if the GUID is enabled:

if (SystemState.IsApplicationLauncherEnabled(strGuid) == true) {
batteryLevel = new SystemState(strGuid);
batteryLevel.Changed += ChangeEventHandler(ChangeOccurred);
} else {
batteryLevel.ComparisonType = StatusComparisonType.Less;
batteryLevel.ComparisonValue = BatteryState.Critical;
batteryLevel.EnableApplicationLauncher(strGuid);
}

Every time I run my code, "IsApplicationLauncherEnabled" is true.

I have tried disabling it using the Exit Menu Item's Clicked event like this:

void Exit_Clicked(object sender, EventArgs e) {
SystemState.DisableApplicationLauncher(strGuid);
}

....and like this:

void Exit_Clicked(object sender, EventArgs e) {
batteryLevel.DisableApplicationLauncher();
}

Neither version seems to disable the Application Launch condition.

I am new to these techniques, so I could be calling them incorrectly;
however, there appears to be a general lack of complete examples on the
subject that I can find on either MSDN or the rest of the Internet.

Could someone offer any advice?

Regards,
~Joe

Note: This will be cross posted in the following discussion groups:
C# Developer, and
Pocket PC Developer
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NTbackup SystemState Jack B. Pollack Windows XP General 2 28th Jul 2008 04:18 PM
SystemState davebythesea Microsoft Dot NET Compact Framework 4 17th Apr 2008 09:08 AM
NTbackup systemstate Cameron Dorrough Microsoft Windows 2000 Advanced Server 0 20th Jun 2005 08:35 AM
Backup SystemState Jeffrey L Microsoft Windows 2000 Advanced Server 2 10th Feb 2005 10:20 PM
ERD vs. Systemstate backup Ariel Microsoft Windows 2000 0 26th Feb 2004 02:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:13 PM.