[Roam-commit] SF.net SVN: roam: [113] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2008-02-09 11:59:21
|
Revision: 113
http://roam.svn.sourceforge.net/roam/?rev=113&view=rev
Author: jonfroehlich
Date: 2008-02-09 03:59:17 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
1. added snoozing events to NotificationForm
2. added the FileUtils static utility class and wrote one function which returns the binary data of a file
Modified Paths:
--------------
Trunk/Source/Roam.Common/Roam.Common.csproj
Trunk/Source/Roam.Test/Roam.Test.csproj
Trunk/Source/Roam.UI/Forms/NotificationForm.cs
Added Paths:
-----------
Trunk/Source/Roam.Common/Utils/FileUtils.cs
Modified: Trunk/Source/Roam.Common/Roam.Common.csproj
===================================================================
--- Trunk/Source/Roam.Common/Roam.Common.csproj 2008-02-08 03:11:13 UTC (rev 112)
+++ Trunk/Source/Roam.Common/Roam.Common.csproj 2008-02-09 11:59:17 UTC (rev 113)
@@ -78,6 +78,7 @@
<Compile Include="Utils\DirectoryUtils.cs" />
<Compile Include="Utils\EnumUtils.cs" />
<Compile Include="Utils\ErrorUtils.cs" />
+ <Compile Include="Utils\FileUtils.cs" />
<Compile Include="Utils\ImagingUtils.cs" />
<Compile Include="Utils\MeasurementUtils.cs" />
<Compile Include="Utils\SummaryStatistics.cs" />
Added: Trunk/Source/Roam.Common/Utils/FileUtils.cs
===================================================================
--- Trunk/Source/Roam.Common/Utils/FileUtils.cs (rev 0)
+++ Trunk/Source/Roam.Common/Utils/FileUtils.cs 2008-02-09 11:59:17 UTC (rev 113)
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace Roam.Common.Utils
+{
+ public static class FileUtils
+ {
+ public static byte[] GetBinaryData(string filename)
+ {
+ FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
+ int length = (int)fs.Length;
+ byte[] data = new byte[length];
+ int bytesRead = fs.Read(data, 0, length);
+ fs.Close();
+ return data;
+ }
+ }
+}
Modified: Trunk/Source/Roam.Test/Roam.Test.csproj
===================================================================
--- Trunk/Source/Roam.Test/Roam.Test.csproj 2008-02-08 03:11:13 UTC (rev 112)
+++ Trunk/Source/Roam.Test/Roam.Test.csproj 2008-02-09 11:59:17 UTC (rev 113)
@@ -83,12 +83,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Media\MediaCapturedTest.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Media\MediaCapturedTest.Designer.cs">
- <DependentUpon>MediaCapturedTest.cs</DependentUpon>
- </Compile>
<Compile Include="Media\SoundLoopPlayerTest.cs">
<SubType>Form</SubType>
</Compile>
@@ -138,10 +132,6 @@
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Media\MediaCapturedTest.resx">
- <SubType>Designer</SubType>
- <DependentUpon>MediaCapturedTest.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="Media\SoundLoopPlayerTest.resx">
<SubType>Designer</SubType>
<DependentUpon>SoundLoopPlayerTest.cs</DependentUpon>
@@ -574,7 +564,7 @@
<DependentUpon>TextBoxFilteredListTest.cs</DependentUpon>
</Compile>
<Compile Include="UI\Controls\FontTest.cs">
- <SubType>Component</SubType>
+ <SubType>Form</SubType>
</Compile>
<Compile Include="UI\Controls\FontTest.Designer.cs">
<DependentUpon>FontTest.cs</DependentUpon>
Modified: Trunk/Source/Roam.UI/Forms/NotificationForm.cs
===================================================================
--- Trunk/Source/Roam.UI/Forms/NotificationForm.cs 2008-02-08 03:11:13 UTC (rev 112)
+++ Trunk/Source/Roam.UI/Forms/NotificationForm.cs 2008-02-09 11:59:17 UTC (rev 113)
@@ -41,6 +41,9 @@
{
private static readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof(NotificationForm));
+ public event EventHandler Snoozing;
+ public event EventHandler Snoozed;
+
#region Private Fields
private IImage _imgOverlay;
private IImage _img;
@@ -405,6 +408,22 @@
_log.DebugFormat("{0}:OnLoad : Exited", Text);
}
+ protected virtual void OnSnoozing(EventArgs e)
+ {
+ if (Snoozing != null)
+ {
+ Snoozing(this, e);
+ }
+ }
+
+ protected virtual void OnSnoozed(EventArgs e)
+ {
+ if (Snoozed != null)
+ {
+ Snoozed(this, e);
+ }
+ }
+
protected virtual void StartNotify()
{
if (_turnOnScreen)
@@ -502,8 +521,10 @@
{
_reminderCount++;
_timer.Interval = (int)_snoozeInterval.TotalMilliseconds;
+ OnSnoozing(EventArgs.Empty);
_isSnoozing = true;
this.Visible = false;
+ OnSnoozed(EventArgs.Empty);
_log.DebugFormat("{0}:UpdateSnoozeDisplayTimer : Repeat count set to {1}; SnoozeInterval timer set to {2}",
Text, _reminderCount, _snoozeInterval);
}
@@ -525,7 +546,6 @@
Text, _isSnoozing, this.Visible, _reminderCount, _timer.Enabled);
}
}
-
#endregion Protected Methods
#region Private Methods
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|