1: /// <summary>
2: /// Represents a post that is sent or received by a MetaWeblog service.
3: /// </summary>
4: [Serializable]
5: [SuppressMessage("Microsoft.Design", "CA1035", 6: Justification = "Supports XML-RPC.NET")]
7: [SuppressMessage("Microsoft.Naming", "CA1710", 8: Justification = "Supports XML-RPC.NET")]
9: [SuppressMessage("Microsoft.Usage", "CA2229", 10: Justification = "Supports XML-RPC.NET")]
11: public class Post : XmlRpcStruct { 12: /// <summary>
13: /// The name of the <see cref="AllowComments"/> field.
14: /// </summary>
15: public const string AllowCommentsName = "mt_allow_comments";
16:
17: /// <summary>
18: /// The name of the <see cref="AllowPings"/> field.
19: /// </summary>
20: public const string AllowPingsName = "mt_allow_pings";
21:
22: /// <summary>
23: /// The name of the <see cref="Author"/> field.
24: /// </summary>
25: public const string AuthorName = "author";
26:
27: /// <summary>
28: /// The name of the <see cref="BaseName"/> field.
29: /// </summary>
30: public const string BaseNameName = "mt_base_name";
31:
32: /// <summary>
33: /// The name of the <see cref="Body"/> field.
34: /// </summary>
35: public const string BodyName = "mt_text_more";
36:
37: /// <summary>
38: /// The name of the <see cref="Categories"/> field.
39: /// </summary>
40: public const string CategoriesName = "categories";
41:
42: /// <summary>
43: /// The name of the <see cref="Comments"/> field.
44: /// </summary>
45: public const string CommentsName = "comments";
46:
47: /// <summary>
48: /// The name of the <see cref="DateCreated"/> field.
49: /// </summary>
50: public const string DateCreatedName = "dateCreated";
51:
52: /// <summary>
53: /// The name of the <see cref="Description"/> field.
54: /// </summary>
55: public const string DescriptionName = "description";
56:
57: /// <summary>
58: /// The name of the <see cref="Enclosure"/> field.
59: /// </summary>
60: public const string EnclosureName = "enclosure";
61:
62: /// <summary>
63: /// The name of the <see cref="Excerpt"/> field.
64: /// </summary>
65: public const string ExcerptName = "excerpt";
66:
67: /// <summary>
68: /// The name of the <see cref="Guid"/> field.
69: /// </summary>
70: public const string GuidName = "guid";
71:
72: /// <summary>
73: /// The name of the <see cref="Keywords"/> field.
74: /// </summary>
75: public const string KeywordsName = "keywords";
76:
77: /// <summary>
78: /// The name of the <see cref="Link"/> field.
79: /// </summary>
80: public const string LinkName = "link";
81:
82: /// <summary>
83: /// The name of the <see cref="Password"/> field.
84: /// </summary>
85: public const string PasswordName = "password";
86:
87: /// <summary>
88: /// The name of the <see cref="PublicationDate"/> field.
89: /// </summary>
90: public const string PublicationDateName = "publicationDate";
91:
92: /// <summary>
93: /// The name of the <see cref="Publish"/> field.
94: /// </summary>
95: public const string PublishName = "publish";
96:
97: /// <summary>
98: /// The name of the <see cref="Slug"/> field.
99: /// </summary>
100: public const string SlugName = "wp_slug";
101:
102: /// <summary>
103: /// The name of the <see cref="Source"/> field.
104: /// </summary>
105: public const string SourceName = "source";
106:
107: /// <summary>
108: /// The name of the <see cref="Title"/> field.
109: /// </summary>
110: public const string TitleName = "title";
111:
112: /// <summary>
113: /// The name of the <see cref="TrackbackPingUrls"/> field.
114: /// </summary>
115: public const string TrackbackPingUrlsName = "mt_tb_ping_urls";
116:
117: /// <summary>
118: /// The name of the <see cref="WPAuthor"/> field.
119: /// </summary>
120: public const string WPAuthorName = "wp_author";
121:
122: /// <summary>
123: /// Gets or sets whether comments are allowed for the post.
124: /// </summary>
125: /// <remarks>
126: /// <para>
127: /// This field corresponds to the <c>mt_allow_comments</c> field
128: /// of the post structure.
129: /// </para>
130: /// <para>
131: /// <list>
132: /// <listheader>
133: /// <term>Value</term>
134: /// <description>Description</description>
135: /// </listheader>
136: /// <item>
137: /// <term>0</term>
138: /// <description>No comments are allowed.</description>
139: /// </item>
140: /// <item>
141: /// <term>1</term>
142: /// <description>Comments can be read and written.</description>
143: /// </item>
144: /// <item>
145: /// <term>2</term>
146: /// <description>Comments can be read but not written.</description>
147: /// </item>
148: /// </list>
149: /// </para>
150: /// </remarks>
151: public int AllowComments { 152: get { return (int)this[AllowCommentsName]; } 153: set { this[AllowCommentsName] = value; } 154: }
155:
156: /// <summary>
157: /// Gets or sets whether Trackback pings are allowed on the post.
158: /// </summary>
159: public int AllowPings { 160: get { return (int)this[AllowPingsName]; } 161: set { this[AllowPingsName] = value; } 162: }
163:
164: /// <summary>
165: /// Gets or sets the email address of the author of the blog post.
166: /// </summary>
167: public string Author { 168: get { return (string)this[AuthorName]; } 169: set { this[AuthorName] = value; } 170: }
171:
172: /// <summary>
173: /// Gets or sets the base name for the post.
174: /// </summary>
175: /// <remarks>
176: /// This property corresponds to the <c>mt_basename</c> field of the
177: /// post structure.
178: /// </remarks>
179: public string BaseName { 180: get { return (string)this[BaseNameName]; } 181: set { this[BaseNameName] = value; } 182: }
183:
184: /// <summary>
185: /// Gets or sets the body text of the blog post.
186: /// </summary>
187: /// <remarks>
188: /// This field corresponds to the <c>mt_text_more</c> field of the
189: /// post structure.
190: /// </remarks>
191: public string Body { 192: get { return (string)this[BodyName]; } 193: set { this[BodyName] = value; } 194: }
195:
196: /// <summary>
197: /// Gets or sets the categories for the blog post.
198: /// </summary>
199: [SuppressMessage("Microsoft.Performance", "CA1819", 200: Justification = "Supports XML-RPC.NET")]
201: public string[] Categories { 202: get { return (string[])this[CategoriesName]; } 203: set { this[CategoriesName] = value; } 204: }
205:
206: /// <summary>
207: /// Gets or sets the URL of the comments page for the post.
208: /// </summary>
209: public string Comments { 210: get { return (string)this[CommentsName]; } 211: set { this[CommentsName] = value; } 212: }
213:
214: /// <summary>
215: /// Gets or sets the date and time that a post was created.
216: /// </summary>
217: public DateTime DateCreated { 218: get { return (DateTime)this[DateCreatedName]; } 219: set { this[DateCreatedName] = value; } 220: }
221:
222: /// <summary>
223: /// Gets or sets the content or body of the post.
224: /// </summary>
225: public string Description { 226: get { return (string)this[DescriptionName]; } 227: set { this[DescriptionName] = value; } 228: }
229:
230: /// <summary>
231: /// Gets or sets a structure containing information about a media
232: /// object that is attached to the item.
233: /// </summary>
234: [SuppressMessage("Microsoft.Usage", "CA2227", 235: Justification = "Supports XML-RPC.NET")]
236: public XmlRpcStruct Enclosure { 237: get { return (XmlRpcStruct)this[EnclosureName]; } 238: set { this[EnclosureName] = value; } 239: }
240:
241: /// <summary>
242: /// Gets or sets the excerpt for the post.
243: /// </summary>
244: /// <remarks>
245: /// This property corresponds to the <c>mt_excerpt</c> field of the
246: /// post structure.
247: /// </remarks>
248: public string Excerpt { 249: get { return (string)this[ExcerptName]; } 250: set { this[ExcerptName] = value; } 251: }
252:
253: /// <summary>
254: /// Gets or sets the unique identifier for the post.
255: /// </summary>
256: public string Guid { 257: get { return (string)this[GuidName]; } 258: set { this[GuidName] = value; } 259: }
260:
261: /// <summary>
262: /// Gets or sets the keywords for the post.
263: /// </summary>
264: /// <remarks>
265: /// This field corresponds to the <c>mt_keywords</c> field of the
266: /// post structure.
267: /// </remarks>
268: public string Keywords { 269: get { return (string)this[KeywordsName]; } 270: set { this[KeywordsName] = value; } 271: }
272:
273: /// <summary>
274: /// Gets or sets the URL of the item.
275: /// </summary>
276: public string Link { 277: get { return (string)this[LinkName]; } 278: set { this[LinkName] = value; } 279: }
280:
281: /// <summary>
282: /// Gets or sets the password for the post.
283: /// </summary>
284: /// <remarks>
285: /// This field corresponds to the <c>wp_password</c> field of the
286: /// post structure.
287: /// </remarks>
288: public string Password { 289: get { return (string)this[PasswordName]; } 290: set { this[PasswordName] = value; } 291: }
292:
293: /// <summary>
294: /// Gets or sets the publication date for the post.
295: /// </summary>
296: public DateTime PublicationDate { 297: get { return (DateTime)this[PublicationDateName]; } 298: set { this[PublicationDateName] = value; } 299: }
300:
301: /// <summary>
302: /// Gets or sets a flag indicating whether the post is published.
303: /// </summary>
304: public bool Publish { 305: get { return (bool)this[PublishName]; } 306: set { this[PublishName] = value; } 307: }
308:
309: /// <summary>
310: /// Gets or sets the slug value.
311: /// </summary>
312: /// <remarks>
313: /// This property corresponds to the <c>wp_slug</c> field of the
314: /// post structure.
315: /// </remarks>
316: public string Slug { 317: get { return (string)this[SlugName]; } 318: set { this[SlugName] = value; } 319: }
320:
321: /// <summary>
322: /// Gets or sets the source information for the post.
323: /// </summary>
324: [SuppressMessage("Microsoft.Usage", "CA2227", 325: Justification = "Supports XML-RPC.NET")]
326: public XmlRpcStruct Source { 327: get { return (XmlRpcStruct)this[SourceName]; } 328: set { this[SourceName] = value; } 329: }
330:
331: /// <summary>
332: /// Gets or sets the title of the blog post.
333: /// </summary>
334: public string Title { 335: get { return (string)this[TitleName]; } 336: set { this[TitleName] = value; } 337: }
338:
339: /// <summary>
340: /// Gets or sets the collection of Trackback ping URLs associated
341: /// with the post.
342: /// </summary>
343: /// <remarks>
344: /// This property corresponds to the <c>mt_tb_ping_urls</c> field
345: /// of the blog post.
346: /// </remarks>
347: [SuppressMessage("Microsoft.Performance", "CA1819", 348: Justification = "Supports XML-RPC.NET")]
349: public string[] TrackbackPingUrls { 350: get { return (string[])this[TrackbackPingUrls]; } 351: set { this[TrackbackPingUrls] = value; } 352: }
353:
354: /// <summary>
355: /// Gets or sets the author of the post.
356: /// </summary>
357: /// <remarks>
358: /// This field corresponds to the <c>wp_author</c> field of the
359: /// post structure.
360: /// </remarks>
361: public string WPAuthor { 362: get { return (string)this[WPAuthor]; } 363: set { this[WPAuthor] = value; } 364: }
365: }