Skip to content

Commit dc3318a

Browse files
committed
Improved XML documentation and some cleanup
1 parent 69a659e commit dc3318a

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/Skybrud.Umbraco.RssUtils/RssFeed.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class RssFeed {
3434

3535
/// <summary>
3636
/// Gets or sets the generator of the feed. If you're a good fellow,
37-
/// you will set this to &quot;Skybrud.Umbraco.RssUtils&quot;, but
37+
/// you will set this to <code>Skybrud.Umbraco.RssUtils</code>, but
3838
/// this is not a requirement.
3939
/// </summary>
4040
public string Generator { get; set; }
@@ -52,7 +52,7 @@ public class RssFeed {
5252
/// <summary>
5353
/// Gets or sets the publication date of the feed. If no publication date has been explicitly
5454
/// set, the publication date of the most recent item will be used instead - or
55-
/// <var>DateTime.Now</var> if the feed is empty.
55+
/// <code>DateTime.Now</code> if the feed is empty.
5656
/// </summary>
5757
public DateTime PubDate {
5858
get {
@@ -82,24 +82,24 @@ public RssFeed() {
8282
}
8383

8484
/// <summary>
85-
/// Adds the children of the specified <var>IPublishedContent</var> as RSS items.
85+
/// Adds the children of the specified <code>IPublishedContent</code> as RSS items.
8686
/// </summary>
8787
/// <param name="parent">The parent of the nodes to be added.</param>
8888
public RssFeed(IPublishedContent parent) : this() {
8989
AddRange(parent.Children);
9090
}
9191

9292
/// <summary>
93-
/// Adds the children of the specified <var>IPublishedContent</var> as RSS items.
93+
/// Adds the children of the specified <code>IPublishedContent</code> as RSS items.
9494
/// </summary>
9595
/// <param name="parent">The parent of the nodes to be added.</param>
96-
/// <param name="func">Function to convert an <var>IPublishedContent</var> to <var>RssItem</var>.</param>
96+
/// <param name="func">Function to convert an <code>IPublishedContent</code> to <code>RssItem</code>.</param>
9797
public RssFeed(IPublishedContent parent, Func<IPublishedContent, RssItem> func) : this() {
9898
AddRange(parent.Children, func);
9999
}
100100

101101
/// <summary>
102-
/// Adds the children of the specified <var>IPublishedContent</var> as RSS items.
102+
/// Adds the children of the specified <code>IPublishedContent</code> as RSS items.
103103
/// </summary>
104104
/// <param name="title">The title of the RSS feed.</param>
105105
/// <param name="link">A link to the RSS feed or relevant page.</param>
@@ -111,36 +111,37 @@ public RssFeed(string title, string link, IPublishedContent parent) : this() {
111111
}
112112

113113
/// <summary>
114-
/// Adds the children of the specified <var>IPublishedContent</var> as RSS items.
114+
/// Adds the children of the specified <code>IPublishedContent</code> as RSS items.
115115
/// </summary>
116116
/// <param name="title">The title of the RSS feed.</param>
117117
/// <param name="link">A link to the RSS feed or relevant page.</param>
118118
/// <param name="parent">The parent of the nodes to be added.</param>
119-
/// <param name="func">Function to convert an <var>IPublishedContent</var> to <var>RssItem</var>.</param>
119+
/// <param name="func">Function to convert an <code>IPublishedContent</code> to <code>RssItem</code>.</param>
120120
public RssFeed(string title, string link, IPublishedContent parent, Func<IPublishedContent, RssItem> func) : this() {
121121
Title = title;
122122
Link = link;
123123
AddRange(parent.Children, func);
124124
}
125125

126126
/// <summary>
127-
/// Adds the specified collection of <var>IPublishedContent</var> as RSS items.
127+
/// Adds the specified collection of <code>IPublishedContent</code> as RSS items.
128128
/// </summary>
129129
/// <param name="content">A collection of nodes to be added.</param>
130130
public RssFeed(IEnumerable<IPublishedContent> content) : this() {
131131
AddRange(content);
132132
}
133133

134134
/// <summary>
135-
/// Adds the specified collection of <var>IPublishedContent</var> as RSS items.
135+
/// Adds the specified collection of <code>IPublishedContent</code> as RSS items.
136136
/// </summary>
137137
/// <param name="content">A collection of nodes to be added.</param>
138+
/// <param name="func">Function to convert an <code>IPublishedContent</code> to <code>RssItem</code>.</param>
138139
public RssFeed(IEnumerable<IPublishedContent> content, Func<IPublishedContent, RssItem> func) : this() {
139140
AddRange(content, func);
140141
}
141142

142143
/// <summary>
143-
/// Adds the specified collection of <var>IPublishedContent</var> as RSS items.
144+
/// Adds the specified collection of <code>IPublishedContent</code> as RSS items.
144145
/// </summary>
145146
/// <param name="title">The title of the RSS feed.</param>
146147
/// <param name="link">A link to the RSS feed or relevant page.</param>
@@ -152,12 +153,12 @@ public RssFeed(string title, string link, IEnumerable<IPublishedContent> content
152153
}
153154

154155
/// <summary>
155-
/// Adds the specified collection of <var>IPublishedContent</var> as RSS items.
156+
/// Adds the specified collection of <code>IPublishedContent</code> as RSS items.
156157
/// </summary>
157158
/// <param name="title">The title of the RSS feed.</param>
158159
/// <param name="link">A link to the RSS feed or relevant page.</param>
159160
/// <param name="content">A collection of nodes to be added.</param>
160-
/// <param name="func">Function to convert an <var>IPublishedContent</var> to <var>RssItem</var>.</param>
161+
/// <param name="func">Function to convert an <code>IPublishedContent</code> to <code>RssItem</code>.</param>
161162
public RssFeed(string title, string link, IEnumerable<IPublishedContent> content, Func<IPublishedContent, RssItem> func) : this() {
162163
Title = title;
163164
Link = link;
@@ -193,7 +194,7 @@ private void SortItems() {
193194
_items = _items.OrderByDescending(x => x.PubDate).ToList();
194195
}
195196

196-
public XDocument ToXDocument() {
197+
public virtual XDocument ToXDocument() {
197198

198199
// Initialize the root element of the feed
199200
XElement xRss = new XElement("rss");
@@ -207,6 +208,7 @@ public XDocument ToXDocument() {
207208
);
208209

209210
xRss.Add(xChannel);
211+
210212
// Add extra elements to the channel (if specified)
211213
if (!String.IsNullOrWhiteSpace(Generator)) xChannel.Add(new XElement("generator", Generator));
212214
if (!String.IsNullOrWhiteSpace(Description)) xChannel.Add(new XElement("description", Description));

src/Skybrud.Umbraco.RssUtils/RssItem.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,20 @@ public class RssItem {
2121
public DateTime PubDate { get; set; }
2222

2323
/// <summary>
24-
/// Gets or sets the GUID (global unique identifier) of the feed item.
25-
/// A GUID could be URL of the feed item or some other unique value
26-
/// that identifies the item.
24+
/// Gets or sets the GUID (global unique identifier) of the feed item. A GUID could be URL of the feed item or
25+
/// some other unique value that identifies the item.
2726
/// </summary>
2827
public string Guid { get; set; }
2928

3029
/// <summary>
31-
/// Gets or sets the description of the feed item. If this property is
32-
/// specified, a &lt;description&gt; element will be inserted in the
33-
/// XML representing the feed item.
30+
/// Gets or sets the description of the feed item. If this property is specified, a <code>description</code>
31+
/// element will be inserted in the XML representing the feed item.
3432
/// </summary>
3533
public string Description { get; set; }
3634

3735
/// <summary>
38-
/// Gets or sets the content of the feed item. If this property is
39-
/// specified, a &lt;content:encoded&gt; element will be inserted in
40-
/// the XML representing the feed item.
36+
/// Gets or sets the content of the feed item. If this property is specified, a <code>content:encoded</code>
37+
/// element will be inserted in the XML representing the feed item.
4138
/// </summary>
4239
public string Content { get; set; }
4340

0 commit comments

Comments
 (0)