]> khamidou — GitHub mirrors - inbox.net.git/commitdiff
Added Tag methods
authorGSonofNun <sonofnun@outlook.com>
Tue, 16 Sep 2014 15:41:46 +0000 (11:41 -0400)
committerGSonofNun <sonofnun@outlook.com>
Tue, 16 Sep 2014 15:41:46 +0000 (11:41 -0400)
Test_WinRT/Test_WinRT.Windows/MainPage.xaml.cs
inbox_net/DataModel/CanonicalTags.cs [new file with mode: 0644]
inbox_net/DataModel/Draft.cs
inbox_net/DataModel/File.cs
inbox_net/DataModel/Message.cs
inbox_net/DataModel/Namespace.cs
inbox_net/DataModel/Participant.cs
inbox_net/DataModel/Tag.cs
inbox_net/DataModel/Thread.cs
inbox_net/inbox_net.csproj

index 87e66cd753c102128692c98255e4af9bdecc4728..9e8d576c978fed734997da606bf31a6ebbba1307 100644 (file)
@@ -35,7 +35,10 @@ namespace Test_WinRT
             InboxClient client = new InboxClient("http://inboxdev.cloudapp.net:5555/");
             Namespace ns = await client.GetFirstNamespace();
             client.Namespace = ns.Namespace_ID;
-            Namespace ns2 = await client.GetNamespace(client.Namespace);
+            List<Tag> tags = new List<Tag>(await client.GetTags());
+            //Tag tag = await client.GetTag("Test Tag");
+            Tag tag = tags.Where(t => t.Name == "TestTag").First();
+            Tag tag2 = await client.RenameCustomTag(tag.ID, "Other Test");
         }
 
 
diff --git a/inbox_net/DataModel/CanonicalTags.cs b/inbox_net/DataModel/CanonicalTags.cs
new file mode 100644 (file)
index 0000000..dbb1612
--- /dev/null
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace inbox_net.DataModel
+{
+    public sealed class CanonicalTags
+    {
+        public static readonly string Inbox = "inbox";
+        public static readonly string Archive = "archive";
+        public static readonly string Drafts = "drafts";
+        public static readonly string Sending = "sending";
+        public static readonly string Sent = "sent";
+        public static readonly string Spam = "spam";
+        public static readonly string Starred = "starred";
+        public static readonly string Unread = "unread";
+        public static readonly string Trash = "trash";
+        public static readonly string Unseen = "unseen";
+    }
+}
index 0f20514b6a42c7a6d68b04eeaac3ddca857ae500..d0d8f7a7c0f65e15b782cc580e8bd00ed329be99 100644 (file)
@@ -35,5 +35,10 @@ namespace inbox_net.DataModel
         [JsonProperty("version")]
         public string Version { get; set; }
 
+
+        public override string ToString()
+        {
+            return Subject;
+        }
     }
 }
index fe9d771630291e652c40366a9a6a6e73e4956b9f..a1c947b2a1229679967a4c70e5cdad16325f3017 100644 (file)
@@ -35,6 +35,9 @@ namespace inbox_net.DataModel
         [JsonProperty("is_embedded")]
         public bool IsEmbeded { get; set; }
 
-
+        public override string ToString()
+        {
+            return FileName;
+        }
     }
 }
index ad3df919dc9af249c61e3877284a384b36104ffa..73ab9d9b939b6b08ce424d3ce48e33fd45275695 100644 (file)
@@ -50,5 +50,9 @@ namespace inbox_net.DataModel
         [JsonProperty("body")]
         public string Body { get; set; }
 
+        public override string ToString()
+        {
+            return Subject;
+        }
     }
 }
index d9bf96b7b22a47755e3a89b6fd7fed3f907f1a10..ffc012f9c460ffa874fa7b559418217102759fa7 100644 (file)
@@ -29,5 +29,9 @@ namespace inbox_net.DataModel
         [JsonProperty("provider")]
         public string Provider { get; set; }
 
+        public override string ToString()
+        {
+            return Email_Address;
+        }
     }
 }
index 732a09fea0de247c0d0373ccaa2ae972d49ecbfc..9ef31e08fe72119a99636f86472e5870c53a5fd5 100644 (file)
@@ -17,5 +17,9 @@ namespace inbox_net.DataModel
         [JsonProperty("email")]
         public string Email_Address { get; set; }
 
+        public override string ToString()
+        {
+            return string.Format("{0} - {1}", Name, Email_Address);
+        }
     }
 }
index dc598b73ab5a41a8b9ce66cb9c148c7ee63a6c6f..e802ea72a2adcc1b95cbc6540deac5201b3bcfcd 100644 (file)
@@ -23,5 +23,10 @@ namespace inbox_net.DataModel
         [JsonProperty("object")]
         public string Object { get; set; }
 
+
+        public override string ToString()
+        {
+            return Name;
+        }
     }
 }
index 36f3986f600ff7a2b176cd283a39d95926a8e9ce..25d3ff139411b8e69ed0fecf99637e6c621afb4b 100644 (file)
@@ -44,5 +44,10 @@ namespace inbox_net.DataModel
         [JsonProperty("draft_ids")]
         public List<string> Drafts { get; set; }
 
+
+        public override string ToString()
+        {
+            return Subject;
+        }
     }
 }
index 1d30f4b5dba49f86024d641d5cfac51c06b19d25..62941c77551ccf398802b0a0a6333f31c92b6662 100644 (file)
@@ -35,6 +35,7 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Compile Include="DataModel\CanonicalTags.cs" />
     <Compile Include="DataModel\Draft.cs" />
     <Compile Include="DataModel\File.cs" />
     <Compile Include="DataModel\Message.cs" />