incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject wp7 commit: adjusted contact deserialization for updated exec calls
Date Wed, 15 Aug 2012 00:49:22 GMT
Updated Branches:
  refs/heads/master 9c0c1f8f6 -> 86d1b25ed


adjusted contact deserialization for updated exec calls


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/86d1b25e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/86d1b25e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/86d1b25e

Branch: refs/heads/master
Commit: 86d1b25eddfbd9e285e7a958674b0af057b34c32
Parents: 9c0c1f8
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Tue Aug 14 17:48:03 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Tue Aug 14 17:48:03 2012 -0700

----------------------------------------------------------------------
 .../standalone/cordovalib/Commands/Contacts.cs     |   18 ++++++++++++--
 1 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/86d1b25e/templates/standalone/cordovalib/Commands/Contacts.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/Contacts.cs b/templates/standalone/cordovalib/Commands/Contacts.cs
index ea1f2d6..1157b91 100644
--- a/templates/standalone/cordovalib/Commands/Contacts.cs
+++ b/templates/standalone/cordovalib/Commands/Contacts.cs
@@ -196,8 +196,12 @@ namespace WP7CordovaClassLib.Cordova.Commands
         // refer here for contact properties we can access: http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.savecontacttask_members%28v=VS.92%29.aspx
         public void save(string jsonContact)
         {
+
             // jsonContact is actually an array of 1 {contact}
-            JSONContact contact = JSON.JsonHelper.Deserialize<JSONContact[]>(jsonContact)[0];
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(jsonContact);
+
+
+            JSONContact contact = JSON.JsonHelper.Deserialize<JSONContact>(args[0])
;
 
             SaveContactTask contactTask = new SaveContactTask();
 
@@ -289,6 +293,11 @@ namespace WP7CordovaClassLib.Cordova.Commands
             }
             #endregion
 
+            if (contact.note != null && contact.note.Length > 0)
+            {
+                contactTask.Notes = contact.note;
+            }
+
             #region contact.addresses
             if (contact.addresses != null && contact.addresses.Length > 0)
             {
@@ -372,10 +381,13 @@ namespace WP7CordovaClassLib.Cordova.Commands
 
         public void search(string searchCriteria)
         {
-            ContactSearchParams searchParams = null;
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(searchCriteria);
+
+            ContactSearchParams searchParams = new ContactSearchParams();
             try
             {
-                searchParams = JSON.JsonHelper.Deserialize<ContactSearchParams[]>(searchCriteria)[0];
+                searchParams.fields = JSON.JsonHelper.Deserialize<string[]>(args[0]);
+                searchParams.options = JSON.JsonHelper.Deserialize<SearchOptions>(args[1]);
             }
             catch (Exception)
             {


Mime
View raw message