-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathDataSourceReference.cs
67 lines (60 loc) · 1.79 KB
/
DataSourceReference.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.Xml;
using System.Threading.Tasks;
using Waher.Content.Xml;
using Waher.Runtime.Language;
namespace Waher.Networking.XMPP.Concentrator
{
/// <summary>
/// Data Source Reference
/// </summary>
public class DataSourceReference
{
private readonly string sourceID;
private readonly string name;
private readonly bool hasChildren;
private readonly DateTime lastChanged;
/// <summary>
/// Data Source Reference
/// </summary>
/// <param name="SourceId">Data Source ID</param>
/// <param name="Name">Human readable name of data source.</param>
/// <param name="HasChildren">If the source has child data sources.</param>
/// <param name="LastChanged">Timestamp of last change.</param>
public DataSourceReference(string SourceId, string Name, bool HasChildren, DateTime LastChanged)
{
this.sourceID = SourceId;
this.name = Name;
this.hasChildren = HasChildren;
this.lastChanged = LastChanged;
}
/// <summary>
/// Data Source Reference
/// </summary>
/// <param name="E">XML Definition.</param>
public DataSourceReference(XmlElement E)
{
this.sourceID = XML.Attribute(E, "src");
this.name = XML.Attribute(E, "name");
this.hasChildren = XML.Attribute(E, "hasChildren", false);
this.lastChanged = XML.Attribute(E, "lastChanged", DateTime.MinValue);
}
/// <summary>
/// Source ID
/// </summary>
public string SourceID => this.sourceID;
/// <summary>
/// Human readable name of data source.
/// </summary>
public string Name => this.name;
/// <summary>
/// If the source has child data sources.
/// </summary>
public bool HasChildren => this.hasChildren;
/// <summary>
/// Timestamp of last change.
/// </summary>
public DateTime LastChanged => this.lastChanged;
}
}