Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RssSource.cs
1
using
System
;
2
using
System.Xml;
3
using
Waher.Content.Xml
;
4
using
Waher.Runtime.Collections
;
5
6
namespace
Waher.Content.Rss
7
{
11
public
class
RssSource
12
{
18
public
RssSource
(XmlElement Xml, Uri BaseUri)
19
{
20
if
(Xml is
null
)
21
throw
new
ArgumentNullException(nameof(Xml));
22
23
ChunkedList<RssWarning>
Warnings
=
new
ChunkedList<RssWarning>
();
24
25
this.Title = Xml.InnerText;
26
27
if
(Xml.HasAttribute(
"url"
))
28
{
29
string
s =
XML
.
Attribute
(Xml,
"url"
);
30
if
(Uri.TryCreate(BaseUri, s, out Uri
Url
))
31
this.Url =
Url
;
32
else
33
Warnings
.Add(
new
RssWarning
(Xml,
"Invalid URI: "
+ s));
34
}
35
else
36
this.Url =
null
;
37
38
this.Warnings =
Warnings
.ToArray();
39
}
40
44
public
RssWarning
[]
Warnings
{
get
; }
45
49
public
Uri
Url
{
get
; } =
null
;
50
54
public
string
Title
{
get
; }
55
}
56
}
Waher.Content.Rss.RssSource
RSS channel that the item came from.
Definition:
RssSource.cs:12
Waher.Content.Rss.RssSource.RssSource
RssSource(XmlElement Xml, Uri BaseUri)
RSS channel that the item came from.
Definition:
RssSource.cs:18
Waher.Content.Rss.RssSource.Warnings
RssWarning[] Warnings
Any warning messages created during parsing.
Definition:
RssSource.cs:44
Waher.Content.Rss.RssSource.Title
string Title
Title of the source.
Definition:
RssSource.cs:54
Waher.Content.Rss.RssSource.Url
Uri Url
URL to the source.
Definition:
RssSource.cs:49
Waher.Content.Rss.RssWarning
Contains a warning message.
Definition:
RssWarning.cs:9
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:21
Waher.Content.Xml.XML.Attribute
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition:
XML.cs:1062
Waher.Runtime.Collections.ChunkedList
A chunked list is a linked list of chunks of objects of type T .
Definition:
ChunkedList.cs:54
System
Definition:
Adapters.g.cs:58
Waher.Content.Rss
Definition:
IRssExtension.cs:6
Waher.Content.Xml
Definition:
Attribute.cs:7
Waher.Runtime.Collections
Definition:
ChunkedList.cs:9
IoTGateway
Content
Waher.Content.Rss
RssSource.cs
Generated by
1.9.5