From 2f48485d4460704841032191ad24a533e1d8b8b4 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Fri, 29 Nov 2013 23:05:11 +0100 Subject: [PATCH] update inline docs --- PocketWP/ExternalPocketItem.cs | 162 +++++++++++++++++++-------------- 1 file changed, 95 insertions(+), 67 deletions(-) diff --git a/PocketWP/ExternalPocketItem.cs b/PocketWP/ExternalPocketItem.cs index ba24ab0..9ae3763 100644 --- a/PocketWP/ExternalPocketItem.cs +++ b/PocketWP/ExternalPocketItem.cs @@ -7,73 +7,101 @@ using PropertyChanged; namespace PocketWP { - [ImplementPropertyChanged] - [DataContract] - public class ExternalPocketItem + [ImplementPropertyChanged] + [DataContract] + public class ExternalPocketItem + { + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// + [DataMember] + public string Uri { get; set; } + + /// + /// Gets or sets the tags. + /// + /// + /// The tags. + /// + [DataMember] + public string Tags { get; set; } + + /// + /// Gets or sets the title. + /// + /// + /// The title. + /// + [DataMember] + public string Title { get; set; } + + /// + /// Gets or sets the tweet identifier. + /// + /// + /// The tweet identifier. + /// + [DataMember] + public string TweetId { get; set; } + + /// + /// Gets or sets the callback URI for your app if you want to be called back after adding. + /// + /// + /// The callback URI. + /// + public string CallbackUri { get; set; } + + /// + /// Gets the type. + /// + /// + /// Single/Multiple items. + /// + [DataMember] + public AddType Type { get; internal set; } + + /// + /// Gets or sets the urls. + /// + /// + /// The urls. + /// + [DataMember] + public List Urls { get; set; } + + /// + /// Gets the tags array. + /// + /// + /// The tags array. + /// + [IgnoreDataMember] + public string[] TagsArray { - /// - /// Gets or sets the URI. - /// - /// - /// The URI. - /// - [DataMember] - public string Uri { get; set; } - /// - /// Gets or sets the tags. - /// - /// - /// The tags. - /// - [DataMember] - public string Tags { get; set; } - /// - /// Gets or sets the title. - /// - /// - /// The title. - /// - [DataMember] - public string Title { get; set; } - /// - /// Gets or sets the tweet identifier. - /// - /// - /// The tweet identifier. - /// - [DataMember] - public string TweetId { get; set; } - /// - /// Gets or sets the callback URI for your app if you want to be called back after adding. - /// - /// - /// The callback URI. - /// - public string CallbackUri { get; set; } - [DataMember] - public AddType Type { get; internal set; } - [DataMember] - public List Urls { get; set; } - - [IgnoreDataMember] - public string[] TagsArray - { - get - { - return string.IsNullOrEmpty(Tags) ? null : Tags.Split(','); - } - } - - public string ToEscapedJson() - { - var serialiser = new DataContractJsonSerializer(typeof(ExternalPocketItem)); - using (var stream = new MemoryStream()) - { - serialiser.WriteObject(stream, this); - - var json = Encoding.UTF8.GetString(stream.ToArray(), 0, (int)stream.Length); - return System.Uri.EscapeDataString(json); - } - } + get + { + return string.IsNullOrEmpty(Tags) ? null : Tags.Split(','); + } } + + /// + /// Converts POCO to JSON. + /// + /// + public string ToEscapedJson() + { + var serialiser = new DataContractJsonSerializer(typeof(ExternalPocketItem)); + using (var stream = new MemoryStream()) + { + serialiser.WriteObject(stream, this); + + var json = Encoding.UTF8.GetString(stream.ToArray(), 0, (int)stream.Length); + return System.Uri.EscapeDataString(json); + } + } + } }