[Roam-commit] SF.net SVN: roam: [118] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2008-02-25 09:42:53
|
Revision: 118
http://roam.svn.sourceforge.net/roam/?rev=118&view=rev
Author: jonfroehlich
Date: 2008-02-25 01:42:47 -0800 (Mon, 25 Feb 2008)
Log Message:
-----------
fixed a bug in Sms when the empty constructor was used
fixed another bug when RecipientPhoneNumber was read before being set
Modified Paths:
--------------
Trunk/Source/Roam/PocketOutlook/Sms.cs
Trunk/Source/Roam.Test/Roam.Test.csproj
Trunk/Source/Roam.suo
Modified: Trunk/Source/Roam/PocketOutlook/Sms.cs
===================================================================
--- Trunk/Source/Roam/PocketOutlook/Sms.cs 2008-02-21 19:46:11 UTC (rev 117)
+++ Trunk/Source/Roam/PocketOutlook/Sms.cs 2008-02-25 09:42:47 UTC (rev 118)
@@ -31,7 +31,7 @@
///
/// </remarks>
/// <author>Jon Froehlich</author>
- public class Sms
+ public class Sms : IDisposable
{
private static readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof(Sms));
@@ -65,9 +65,18 @@
public Sms(string recipientPhoneNumber, string message, bool deliveryConfirmation)
{
- _smsMessage = new SmsMessage(recipientPhoneNumber, message);
+ if (string.IsNullOrEmpty(recipientPhoneNumber))
+ {
+ _smsMessage = new SmsMessage();
+ Message = message;
+ }
+ else
+ {
+ _smsMessage = new SmsMessage(recipientPhoneNumber, message);
+ }
+
_smsMessage.RequestDeliveryReport = deliveryConfirmation;
-
+
_phoneSearchingState = new SystemState(SystemProperty.PhoneSearchingForService);
_phoneSearchingState.Changed += new ChangeEventHandler(OnPhoneSearchingForService);
_phoneSignalStrength = new SystemState(SystemProperty.PhoneSignalStrength);
@@ -97,11 +106,15 @@
}
}
+ /// <summary>
+ /// Returns the recipient's phone number. If no recipient has been set, this property
+ /// returns null.
+ /// </summary>
public string RecipientPhoneNumber
{
get
{
- return _smsMessage.To[0].Address;
+ return _smsMessage.To.Count <= 0 ? null : _smsMessage.To[0].Address;
}
set
{
@@ -172,6 +185,7 @@
#endregion Properties
+ #region Methods
public virtual bool Send()
{
return SendInternal();
@@ -307,7 +321,26 @@
_manualResetEvent.Set();
}
}
+ #endregion Methods
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ _phoneSearchingState.Changed -= new ChangeEventHandler(OnPhoneSearchingForService);
+ _phoneSignalStrength.Changed -= new ChangeEventHandler(OnPhoneSignalStrength);
+
+ if (_timer != null)
+ {
+ _timer.Dispose();
+ _timer = null;
+ }
+
+ _manualResetEvent.Close();
+ }
+
+ #endregion
+
#region SMS Error
public const int SMS_E_INVALIDPROTOCOL = 0x0001;
public const int SMS_E_REGISTRATIONEXISTS = 0x0002;
Modified: Trunk/Source/Roam.Test/Roam.Test.csproj
===================================================================
--- Trunk/Source/Roam.Test/Roam.Test.csproj 2008-02-21 19:46:11 UTC (rev 117)
+++ Trunk/Source/Roam.Test/Roam.Test.csproj 2008-02-25 09:42:47 UTC (rev 118)
@@ -564,7 +564,7 @@
<DependentUpon>TextBoxFilteredListTest.cs</DependentUpon>
</Compile>
<Compile Include="UI\Controls\FontTest.cs">
- <SubType>Form</SubType>
+ <SubType>Component</SubType>
</Compile>
<Compile Include="UI\Controls\FontTest.Designer.cs">
<DependentUpon>FontTest.cs</DependentUpon>
@@ -702,7 +702,7 @@
<DependentUpon>SystemColorTest.cs</DependentUpon>
</Compile>
<Compile Include="UI\Controls\TabControlTest.cs">
- <SubType>Form</SubType>
+ <SubType>Component</SubType>
</Compile>
<Compile Include="UI\Controls\TabControlTest.Designer.cs">
<DependentUpon>TabControlTest.cs</DependentUpon>
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.
|