[Roam-commit] SF.net SVN: roam: [103] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2007-11-05 16:45:44
|
Revision: 103
http://roam.svn.sourceforge.net/roam/?rev=103&view=rev
Author: jonfroehlich
Date: 2007-11-05 08:45:36 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
added backlight turn on option to NotificationForm
Modified Paths:
--------------
Trunk/Source/Roam.UI/Forms/NotificationForm.cs
Trunk/Source/Roam.suo
Modified: Trunk/Source/Roam.UI/Forms/NotificationForm.cs
===================================================================
--- Trunk/Source/Roam.UI/Forms/NotificationForm.cs 2007-11-03 21:23:49 UTC (rev 102)
+++ Trunk/Source/Roam.UI/Forms/NotificationForm.cs 2007-11-05 16:45:36 UTC (rev 103)
@@ -26,6 +26,7 @@
using Roam.Common.Utils;
using Microsoft.WindowsMobile.Status;
using Roam.Media;
+using Roam.Utils;
namespace Roam.UI.Forms
{
@@ -60,6 +61,7 @@
private bool _autoAppendSnoozeCount = true;
private bool _useSound = true;
private bool _useVibration = true;
+ private bool _turnOnScreen = true;
private bool _useLed = true;
private bool _ignorePhoneProfile = false;
@@ -72,6 +74,7 @@
#endregion Private Fields
+ #region Constructors
public NotificationForm()
{
InitializeComponent();
@@ -94,6 +97,7 @@
imageFactory.CreateImageFromFile(strOverlayImage, out _imgOverlay);
imageFactory.CreateImageFromFile(strBackgroundImage, out _img);
}
+ #endregion Constructors
#region Properties
public NotificationResult NotificationResult
@@ -133,6 +137,12 @@
set { _useLed = value; }
}
+ public bool TurnOnScreen
+ {
+ get { return _turnOnScreen; }
+ set { _turnOnScreen = value; }
+ }
+
public bool IgnorePhoneProfile
{
get { return _ignorePhoneProfile; }
@@ -397,6 +407,11 @@
protected virtual void StartNotify()
{
+ if (_turnOnScreen)
+ {
+ PowerUtils.SetSystemPowerState(IntPtr.Zero, PowerStateFlags.On, PowerUtils.POWER_FORCE);
+ }
+
if (_useSound&& (_ignorePhoneProfile||
(!_ignorePhoneProfile && SystemState.PhoneProfile != "Silent")))
{
@@ -458,8 +473,13 @@
protected virtual void OnTimerTick(object sender, EventArgs e)
{
+ UpdateSnoozeDisplayTimer();
+ }
+
+ protected virtual void UpdateSnoozeDisplayTimer()
+ {
if (_isDisposed || _timer == null) { return; }
- _log.DebugFormat("{0}:OnTimerTick : Entered, Snoozing: {1}, Visible: {2}, RepeatCount: {3}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Entered, Snoozing: {1}, Visible: {2}, RepeatCount: {3}",
Text, _isSnoozing, this.Visible, _reminderCount);
_timer.Enabled = false;
@@ -475,7 +495,7 @@
_menuItemSnooze.Enabled = false;
}
StartNotify();
- _log.DebugFormat("{0}:OnTimerTick : DisplayInterval timer set to {1}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : DisplayInterval timer set to {1}",
Text, _displayInterval);
}
else
@@ -484,16 +504,16 @@
_timer.Interval = (int)_snoozeInterval.TotalMilliseconds;
_isSnoozing = true;
this.Visible = false;
- _log.DebugFormat("{0}:OnTimerTick : Repeat count set to {1}; SnoozeInterval timer set to {2}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Repeat count set to {1}; SnoozeInterval timer set to {2}",
Text, _reminderCount, _snoozeInterval);
}
if (_reminderCount > _maximumReminders)
{
- _log.DebugFormat("{0}:OnTimerTick : Repeat count {1} has exceeded the reminder count threshold {2}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Repeat count {1} has exceeded the reminder count threshold {2}",
Text, _reminderCount, _maximumReminders);
- _log.DebugFormat("{0}:OnTimerTick : Exiting, SnoozeInterval: {1}, Visible: {2}, RepeatCount: {3}, TimerEnabled: {4}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Exiting, SnoozeInterval: {1}, Visible: {2}, RepeatCount: {3}, TimerEnabled: {4}",
Text, _isSnoozing, this.Visible, _reminderCount, _timer.Enabled);
NotificationResult = NotificationResult.AutoDismissed;
DialogResult = DialogResult.No;
@@ -501,7 +521,7 @@
else
{
_timer.Enabled = true;
- _log.DebugFormat("{0}:OnTimerTick : Exiting, SnoozeInterval: {1}, Visible: {2}, RepeatCount: {3}, TimerEnabled: {4}",
+ _log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Exiting, SnoozeInterval: {1}, Visible: {2}, RepeatCount: {3}, TimerEnabled: {4}",
Text, _isSnoozing, this.Visible, _reminderCount, _timer.Enabled);
}
}
@@ -516,14 +536,7 @@
NotificationResult = NotificationResult.OK;
_log.DebugFormat("{0}:OnMenuItemOkClick : Exited", Text);
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
- //setting this property with a value from the DialogResult enumeration
+ //setting this property with a value from the DialogResult enumeration
//sets the value of the dialog box result for the form, hides the modal
//dialog box, and returns control to the calling form
DialogResult = DialogResult.OK;
@@ -536,13 +549,6 @@
NotificationResult = NotificationResult.ManuallyDismissed;
_log.DebugFormat("{0}:OnMenuItemDismissClick : Exited", Text);
- /// <summary>
- ///
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- /// <author>Jon Froehlich</author>
//setting this property with a value from the DialogResult enumeration
//sets the value of the dialog box result for the form, hides the modal
//dialog box, and returns control to the calling form
@@ -552,7 +558,8 @@
private void OnMenuItemSnoozeClick(object sender, EventArgs e)
{
_log.DebugFormat("{0}:OnMenuItemSnoozeClick : Entered", Text);
- OnTimerTick(this, EventArgs.Empty);
+ StopNotify();
+ UpdateSnoozeDisplayTimer();
_log.DebugFormat("{0}:OnMenuItemSnoozeClick : Exited", Text);
}
#endregion Private Methods
Modified: Trunk/Source/Roam.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|