diff --git a/PocketSharp/Models/PocketBoolean.cs b/PocketSharp/Models/PocketBoolean.cs new file mode 100644 index 0000000..5227162 --- /dev/null +++ b/PocketSharp/Models/PocketBoolean.cs @@ -0,0 +1,9 @@ +namespace PocketSharp.Models +{ + public enum PocketBoolean + { + No = 0, + Yes = 1, + IsType = 2 + } +} diff --git a/PocketSharp/Models/PocketItem.cs b/PocketSharp/Models/PocketItem.cs index 492aa43..b3818c7 100644 --- a/PocketSharp/Models/PocketItem.cs +++ b/PocketSharp/Models/PocketItem.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using System.Diagnostics; +using Newtonsoft.Json; using PropertyChanged; using System; using System.Collections.Generic; @@ -11,6 +12,7 @@ namespace PocketSharp.Models /// [JsonObject] [ImplementPropertyChanged] + [DebuggerDisplay("Uri = {Uri}, Title = {Title}")] public class PocketItem { /// @@ -22,6 +24,15 @@ namespace PocketSharp.Models [JsonProperty("item_id")] public int ID { get; set; } + /// + /// Gets or sets the resolved identifier. + /// + /// + /// The resolved identifier. + /// + [JsonProperty("resolved_id")] + public string ResolvedId { get; set; } + /// /// Gets or sets the URI. /// @@ -132,7 +143,7 @@ namespace PocketSharp.Models /// true if this instance has image; otherwise, false. /// [JsonProperty("has_image")] - public bool HasImage { get; set; } + private PocketBoolean _HasImage { get; set; } /// /// Gets or sets a value indicating whether this instance has video. @@ -141,7 +152,67 @@ namespace PocketSharp.Models /// true if this instance has video; otherwise, false. /// [JsonProperty("has_video")] - public bool HasVideo { get; set; } + private PocketBoolean _HasVideo { get; set; } + + /// + /// Gets a value indicating whether [has image]. + /// + /// + /// true if [has image]; otherwise, false. + /// + [JsonIgnore] + public bool HasImage + { + get + { + return _HasImage == PocketBoolean.Yes; + } + } + + /// + /// Gets a value indicating whether [has video]. + /// + /// + /// true if [has video]; otherwise, false. + /// + [JsonIgnore] + public bool HasVideo + { + get + { + return _HasVideo == PocketBoolean.Yes; + } + } + + /// + /// Gets a value indicating whether [is video]. + /// + /// + /// true if [is video]; otherwise, false. + /// + [JsonIgnore] + public bool IsVideo + { + get + { + return _HasVideo == PocketBoolean.IsType; + } + } + + /// + /// Gets a value indicating whether [is image]. + /// + /// + /// true if [is image]; otherwise, false. + /// + [JsonIgnore] + public bool IsImage + { + get + { + return _HasImage == PocketBoolean.IsType; + } + } /// /// Gets or sets the word count. diff --git a/PocketSharp/PocketSharp.csproj b/PocketSharp/PocketSharp.csproj index 6d404b1..09d1d04 100644 --- a/PocketSharp/PocketSharp.csproj +++ b/PocketSharp/PocketSharp.csproj @@ -45,6 +45,7 @@ +