From 82c9ecd6b5ba6e57d07d80000495c05f79203fe0 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Tue, 5 Nov 2013 23:17:45 +0100 Subject: [PATCH] remove Utilities.DictionaryToList - not needed --- PocketSharp/Models/Response/Retrieve.cs | 17 +++------------ PocketSharp/Utilities/Utilities.cs | 29 +++---------------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/PocketSharp/Models/Response/Retrieve.cs b/PocketSharp/Models/Response/Retrieve.cs index 7a98c9c..9a8a30d 100644 --- a/PocketSharp/Models/Response/Retrieve.cs +++ b/PocketSharp/Models/Response/Retrieve.cs @@ -27,25 +27,14 @@ namespace PocketSharp.Models [JsonProperty] public int Since { get; set; } - /// - /// Gets or sets the _ item dictionary. - /// - /// - /// The _ item dictionary. - /// - [JsonProperty("list")] - public Dictionary ItemDictionary { get; set; } - /// /// Gets the items. /// /// /// The items. /// - [JsonIgnore] - public List Items - { - get { return Utilities.DictionaryToList(ItemDictionary); } - } + [JsonProperty("list")] + [JsonConverter(typeof(ObjectToArrayConverter))] + public List Items { get; set; } } } diff --git a/PocketSharp/Utilities/Utilities.cs b/PocketSharp/Utilities/Utilities.cs index b165a63..b98ebae 100644 --- a/PocketSharp/Utilities/Utilities.cs +++ b/PocketSharp/Utilities/Utilities.cs @@ -12,7 +12,9 @@ namespace PocketSharp /// converts DateTime to an UNIX timestamp /// /// The date. - /// UNIX timestamp + /// + /// UNIX timestamp + /// public static int? GetUnixTimestamp(DateTime? dateTime) { if (dateTime == null) @@ -22,30 +24,5 @@ namespace PocketSharp return (int)((DateTime)dateTime - new DateTime(1970, 1, 1)).TotalSeconds; } - - - /// - /// Convert a dictionary to a list - /// - /// - /// The items. - /// - public static List DictionaryToList(Dictionary items) where T : new() - { - if (items == null) - { - return null; - } - - var itemEnumerator = items.GetEnumerator(); - List list = new List(); - - while (itemEnumerator.MoveNext()) - { - list.Add(itemEnumerator.Current.Value); - } - - return list; - } } }