Author: fmantek
Date: Thu Oct 18 02:57:35 2007
New Revision: 305
Modified:
trunk/clients/cs/RELEASE_NOTES.HTML
trunk/clients/cs/src/extensions/reminder.cs
trunk/clients/cs/src/gcalendar/calendarquery.cs
trunk/clients/cs/src/unittests/caltest.cs
Log:
<li> Added a default constructor to CalendarQuery so that you can
use it on .NET CF with a starting URI</li>
<li>Changed the Reminder element to send an empty one to enable
creation of default Reminders in the calendar</li>
Modified: trunk/clients/cs/RELEASE_NOTES.HTML
==============================================================================
--- trunk/clients/cs/RELEASE_NOTES.HTML (original)
+++ trunk/clients/cs/RELEASE_NOTES.HTML Thu Oct 18 02:57:35 2007
@@ -47,6 +47,10 @@
SimpleContainer and AtomBase now implement
IExtensionContainer, a
common interface that encapsulates owning Extension elements.
</li>
+ <li> Added a default constructor to CalendarQuery so that you can
+ use it on .NET CF with a starting URI</li>
+ <li>Changed the Reminder element to send an empty one to enable
+ creation of default Reminders in the calendar</li>
</ul>
</ul>
Modified: trunk/clients/cs/src/extensions/reminder.cs
==============================================================================
--- trunk/clients/cs/src/extensions/reminder.cs (original)
+++ trunk/clients/cs/src/extensions/reminder.cs Thu Oct 18 02:57:35 2007
@@ -61,16 +61,33 @@
/// <item>
/// <term>1 gd:rem</term>
/// <term>*Use user's default settings</term>
- /// <term>No reminder</term>
/// <term>InvalidEntryException</term>
+ /// <term>No reminder</term>
+ /// <term>InvalidEntryException</term>
/// </item>
/// <item>
- /// <term>1 gd:rem min=0</term>
/// <term>*Use user's default settings</term>
/// <term>No reminder</term>
/// <term>InvalidEntryException</term>
/// </item>
+ /// <term>1 gd:rem min=0</term>
+ /// <term>*Use user's default settings</term>
+ /// <term>No reminder</term>
+ /// <term>InvalidEntryException</term>
+ /// </item>
/// <item>
- /// <term>1 gd:rem min=-1</term>
/// <term>*No reminder</term>
/// <term>No reminder</term>
/// <term>InvalidEntryException</term>
/// </item>
+ /// <term>1 gd:rem min=-1</term>
+ /// <term>*No reminder</term>
+ /// <term>No reminder</term>
+ /// <term>InvalidEntryException</term>
+ /// </item>
/// <item>
- /// <term>1 gd:rem min=+n</term>
/// <term>*Override with no +n for user's selected methods</term>
/// <term>No reminder</term>
/// <term>Set exactly one reminder on event at +n with
given method</term>
/// </item>
+ /// <term>1 gd:rem min=+n</term>
+ /// <term>*Override with no +n for user's selected methods</term>
+ /// <term>No reminder</term>
+ /// <term>Set exactly one reminder on event at +n with
given method</term>
+ /// </item>
/// <item>
- /// <term>Multiple gd:rem</term>
/// <term>InvalidEntryException</term>
/// <term>InvalidEntryException</term>
/// <term>Copy this set exactly</term>
/// </item>
+ /// <term>Multiple gd:rem</term>
+ /// <term>InvalidEntryException</term>
+ /// <term>InvalidEntryException</term>
+ /// <term>Copy this set exactly</term>
+ /// </item>
/// </list>
///
/// <para>Hence, to override an event with a set of reminder time, method
@@ -323,41 +340,34 @@
/// <param name="writer">the xmlwriter to write into</param>
public void Save(XmlWriter writer)
{
- if (this.Days > 0 ||
- this.Hours > 0 ||
- this.Minutes > 0 ||
- Utilities.IsPersistable(this.AbsoluteTime))
-
- {
- writer.WriteStartElement(XmlPrefix, XmlName, XmlNameSpace);
+ writer.WriteStartElement(XmlPrefix, XmlName, XmlNameSpace);
- if (Days > 0)
- {
-
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeDays,
this.Days.ToString());
- }
+ if (Days > 0)
+ {
+
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeDays,
this.Days.ToString());
+ }
- if (Hours > 0)
- {
-
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeHours,
this.Hours.ToString());
- }
+ if (Hours > 0)
+ {
+
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeHours,
this.Hours.ToString());
+ }
- if (Minutes > 0)
- {
-
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeMinutes,
this.Minutes.ToString());
- }
+ if (Minutes > 0)
+ {
+
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeMinutes,
this.Minutes.ToString());
+ }
- if (AbsoluteTime != new DateTime(1, 1, 1))
- {
- string date = Utilities.LocalDateTimeInUTC(AbsoluteTime);
-
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeAbsoluteTime,
date);
- }
+ if (AbsoluteTime != new DateTime(1, 1, 1))
+ {
+ string date = Utilities.LocalDateTimeInUTC(AbsoluteTime);
+
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeAbsoluteTime,
date);
+ }
- if (this.Method != ReminderMethod.unspecified)
- {
-
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeMethod,
this.Method.ToString());
- }
- writer.WriteEndElement();
+ if (this.Method != ReminderMethod.unspecified)
+ {
+
writer.WriteAttributeString(GDataParserNameTable.XmlAttributeMethod,
this.Method.ToString());
}
+ writer.WriteEndElement();
}
}
}
Modified: trunk/clients/cs/src/gcalendar/calendarquery.cs
==============================================================================
--- trunk/clients/cs/src/gcalendar/calendarquery.cs (original)
+++ trunk/clients/cs/src/gcalendar/calendarquery.cs Thu Oct 18 02:57:35 2007
@@ -33,5 +33,14 @@
public CalendarQuery() : base()
{
}
+
+ /// <summary>
+ /// base constructor, with initial queryUri
+ /// </summary>
+ /// <param name="queryUri">the query to use</param>
+ public CalendarQuery(string queryUri)
+ : base(queryUri)
+ {
+ }
}
}
Modified: trunk/clients/cs/src/unittests/caltest.cs
==============================================================================
--- trunk/clients/cs/src/unittests/caltest.cs (original)
+++ trunk/clients/cs/src/unittests/caltest.cs Thu Oct 18 02:57:35 2007
@@ -1322,6 +1322,7 @@
//////////////////////////////////////////////////////////////////////
/// <summary>runs a stress test against the calendar</summary>
//////////////////////////////////////////////////////////////////////
+ [Ignore ("Normally not required to run, and takes pretty long")]
[Test] public void CalendarStressTest()
{
Tracing.TraceMsg("Entering CalendarStressTest");
@@ -1517,7 +1518,51 @@
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
- /// <summary>tests the extended property against the calendar</summary>
+ /// <summary>tests that a default reminder get's created if
none is set</summary>
+ //////////////////////////////////////////////////////////////////////
+ [Test] public void CalendarDefaultReminderTest()
+ {
+ Tracing.TraceMsg("Entering CalendarDefaultReminderTest");
+
+ FeedQuery query = new FeedQuery();
+
+ CalendarService service = new
CalendarService(this.ApplicationName);
+
+ if (this.defaultCalendarUri != null)
+ {
+ if (this.userName != null)
+ {
+ service.Credentials = new
GDataCredentials(this.userName, this.passWord);
+ }
+
+ GDataLoggingRequestFactory factory =
(GDataLoggingRequestFactory) this.factory;
+ factory.MethodOverride = true;
+ service.RequestFactory = this.factory;
+
+ query.Uri = new Uri(this.defaultCalendarUri);
+
+ EventFeed calFeed = service.Query(query) as EventFeed;
+
+ EventEntry entry = ObjectModelHelper.CreateEventEntry(1);
+ entry.Title.Text = "New event with default reminder" +
Guid.NewGuid().ToString();
+
+ entry.Reminder = new Reminder();
+ entry.Reminder.Method = Reminder.ReminderMethod.unspecified;
+
+ EventEntry newEntry = calFeed.Insert(entry) as EventEntry;
+ Reminder reminder = newEntry.Reminder;
+ Assert.IsTrue(reminder != null, "reminder should not
be null - this only works if the calendar HAS default remidners set");
+ Assert.IsTrue(reminder.Method !=
Reminder.ReminderMethod.unspecified, "reminder should not be
unspecified - this only works if the calendar HAS default remidners set");
+
+ service.Credentials = null;
+ factory.MethodOverride = false;
+ }
+ }
+
/////////////////////////////////////////////////////////////////////////////
+
+
+ //////////////////////////////////////////////////////////////////////
+ /// <summary>tests the original event </summary>
//////////////////////////////////////////////////////////////////////
[Test] public void CalendarOriginalEventTest()
{
@@ -1595,8 +1640,7 @@
}
}
/////////////////////////////////////////////////////////////////////////////
-
-
+
}
/////////////////////////////////////////////////////////////////////////////
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---