Author: fmantek
Date: Mon Sep 10 01:38:40 2007
New Revision: 245

Modified:
   trunk/clients/cs/RELEASE_NOTES.HTML
   trunk/clients/cs/src/extensions/gdatanametable.cs
   trunk/clients/cs/src/gcalendar/evententry.cs
   trunk/clients/cs/src/unittests/caltest.cs
   trunk/clients/cs/src/unittests/photostest.cs

Log:
Added QuickAdd functionallity

Modified: trunk/clients/cs/RELEASE_NOTES.HTML
==============================================================================
--- trunk/clients/cs/RELEASE_NOTES.HTML (original)
+++ trunk/clients/cs/RELEASE_NOTES.HTML Mon Sep 10 01:38:40 2007
@@ -98,8 +98,10 @@
             <li>Added unittests to query an album and insert a new photo</li>
         </ul>
     </li>
-
-
+    <li> Added the QuickAdd feature for the Google Calendar. An EventEntry 
+        has a QuickAdd boolean property. Setting it to true causes an insert to
+        be treated like a quickAdd operation. 
+    </li> 
 </ul>
 
 <h2>1.0.9.9</h2>

Modified: trunk/clients/cs/src/extensions/gdatanametable.cs
==============================================================================
--- trunk/clients/cs/src/extensions/gdatanametable.cs   (original)
+++ trunk/clients/cs/src/extensions/gdatanametable.cs   Mon Sep 10 01:38:40 2007
@@ -130,6 +130,8 @@
         public const string XmlAttributeHeight= "height";
         ///  <summary>static string for the sendEventNotifications 
element</summary>    
         public const string XmlSendNotificationsElement = 
"sendEventNotifications"; 
+        ///  <summary>static string for the quickAdd element</summary>    
+        public const string XmlQuickAddElement = "quickadd"; 
 #endregion
 
    }

Modified: trunk/clients/cs/src/gcalendar/evententry.cs
==============================================================================
--- trunk/clients/cs/src/gcalendar/evententry.cs        (original)
+++ trunk/clients/cs/src/gcalendar/evententry.cs        Mon Sep 10 01:38:40 2007
@@ -281,6 +281,46 @@
             }
         }
 
+         /// <summary>
+        ///  indicates if this new entry should be a quickadd
+        /// false by default
+        /// </summary>
+        public class QuickAddElement : EnumConstruct
+        {
+            /// <summary>
+            ///  default constructor
+            /// </summary>
+            public QuickAddElement()
+            : base(GDataParserNameTable.XmlQuickAddElement)
+            {
+            }
+
+            /// <summary>
+            ///  constructor with a default string value
+            /// </summary>
+            /// <param name="value">transparency value</param>
+            public QuickAddElement(string value)
+            : base(GDataParserNameTable.XmlQuickAddElement, value)
+            {
+            }
+
+            
//////////////////////////////////////////////////////////////////////
+            /// <summary>Returns the constant representing this XML 
element.</summary> 
+            
//////////////////////////////////////////////////////////////////////
+            public override string XmlNamespace
+            {
+                get { return GDataParserNameTable.NSGCal; }
+            }
+            
//////////////////////////////////////////////////////////////////////
+            /// <summary>Returns the constant representing this XML 
element.</summary> 
+            
//////////////////////////////////////////////////////////////////////
+            public override string XmlNamespacePrefix
+            {
+                get { return GDataParserNameTable.gCalPrefix; }
+            }
+        }
+
+
 
 #region EventEntry Attributes
 
@@ -295,6 +335,7 @@
         private Comments comments;
         private RecurrenceException exception; 
         private SendNotifications sendNotifications;
+        private QuickAddElement quickAdd;
 
 #endregion
 
@@ -341,7 +382,8 @@
         }
 
         /// <summary>
-        ///  property accessor for the Event Visibility 
+        ///  property accessor for the Eventnotifications
+        ///  set this to True for notfications to be send 
         /// </summary>
         public bool Notifications
         {
@@ -375,8 +417,49 @@
 
                 }
             }
+        }
+
+
+        /// <summary>
+        ///  property accessor QuickAdd
+        /// To create an event using Google Calendar's quick add feature, set 
the event 
+        /// entry's content to the quick add string you'd like to use. Then 
add a 
+        /// <gCal:quickadd> element with a value attribute set to true
+        /// </summary>
+        public bool QuickAdd
+        {
+            get { 
+                    if (this.quickAdd == null)
+                    {
+                        return false;
+                    }
+                    return this.quickAdd.Value == "true"; 
+                }
 
+            set 
+            {
+                if (value == true)
+                {
+
+                    if (this.quickAdd == null)
+                    {
+                        this.quickAdd = new QuickAddElement(); 
+                        ExtensionElements.Add(this.quickAdd);
+                    }
+                    this.quickAdd.Value = "true"; 
+                }
+                else 
+                {
+                    if (this.quickAdd != null)
+                    {
+                        ExtensionElements.Remove(this.quickAdd);
+                        this.quickAdd = null; 
+                    }
+                }
+            }
         }
+
+
 
 
         /// <summary>

Modified: trunk/clients/cs/src/unittests/caltest.cs
==============================================================================
--- trunk/clients/cs/src/unittests/caltest.cs   (original)
+++ trunk/clients/cs/src/unittests/caltest.cs   Mon Sep 10 01:38:40 2007
@@ -423,6 +423,59 @@
         }
         
/////////////////////////////////////////////////////////////////////////////
 
+
+        //////////////////////////////////////////////////////////////////////
+        /// <summary>runs an authentication test</summary> 
+        //////////////////////////////////////////////////////////////////////
+        [Test] public void CalendarQuickAddTest()
+        {
+            Tracing.TraceMsg("Entering CalendarQuickAddTest");
+
+            EventQuery query = new EventQuery();
+            CalendarService service = new 
CalendarService(this.ApplicationName);
+
+            int iCount; 
+
+            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;
+
+                iCount = calFeed.Entries.Count; 
+
+                String strTitle = "Dinner & time" + Guid.NewGuid().ToString(); 
+
+                if (calFeed != null)
+                {
+                    // get the first entry
+                    EventEntry entry  = new EventEntry();
+                    entry.Title.Text = "Dinner with Sabine, Oct 1st, 10pm";
+                    entry.Title.Type = AtomTextConstructType.html;
+                    entry.QuickAdd = true;
+
+
+                    EventEntry newEntry = (EventEntry) calFeed.Insert(entry); 
+
+                    
Assert.IsTrue(newEntry.Title.Text.Equals(entry.Title.Text), "both titles should 
be identical"); 
+
+                }
+                service.Credentials = null; 
+                factory.MethodOverride = false;
+            }
+
+        }
+        
/////////////////////////////////////////////////////////////////////////////
+
+       
        //////////////////////////////////////////////////////////////////////
         /// <summary>Tests the reminder method property</summary> 
         //////////////////////////////////////////////////////////////////////

Modified: trunk/clients/cs/src/unittests/photostest.cs
==============================================================================
--- trunk/clients/cs/src/unittests/photostest.cs        (original)
+++ trunk/clients/cs/src/unittests/photostest.cs        Mon Sep 10 01:38:40 2007
@@ -99,7 +99,6 @@
                 AtomFeed feed = service.Query(query);
 
                 
ObjectModelHelper.DumpAtomObject(feed,CreateDumpFileName("PhotoAuthTest")); 
-                iCount = feed.Entries.Count; 
 
                 if (feed != null && feed.Entries.Count > 0)
                 {
@@ -141,8 +140,7 @@
                 PhotoFeed feed = service.Query(query);
 
                 
ObjectModelHelper.DumpAtomObject(feed,CreateDumpFileName("PhotoAuthTest")); 
-                iCount = feed.Entries.Count; 
-
+     
                 if (feed != null && feed.Entries.Count > 0)
                 {
                     Tracing.TraceMsg("Found a Feed " + feed.ToString());

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to