15 [Index(
"JID",
"NodeID",
"SourceID",
"Partition")]
18 private Guid objectId = Guid.Empty;
20 private string nodeId =
string.
Empty;
21 private string sourceId =
string.
Empty;
22 private string partition =
string.
Empty;
23 private Rule[] rules =
null;
39 set => this.objectId = value;
48 set => this.jid = value;
57 set => this.nodeId = value;
66 set => this.sourceId = value;
74 get => this.partition;
75 set => this.partition = value;
85 set => this.rules = value;
94 if (this.rules is
null)
98 int c = this.rules.Length;
99 Array.Resize(ref this.rules, c + 1);
100 this.rules[c] =
Rule;
108 public abstract void Export(XmlWriter Output);
110 protected virtual void ExportContent(XmlWriter Output)
112 Output.WriteAttributeString(
"jid", this.jid);
114 if (!
string.IsNullOrEmpty(this.nodeId))
115 Output.WriteAttributeString(
"id", this.nodeId);
117 if (!
string.IsNullOrEmpty(this.sourceId))
118 Output.WriteAttributeString(
"src", this.sourceId);
120 if (!
string.IsNullOrEmpty(this.partition))
121 Output.WriteAttributeString(
"pt", this.partition);
123 if (!(this.rules is
null))
136 StringBuilder sb =
new StringBuilder();
139 using (XmlWriter w = XmlWriter.Create(sb, Settings))
144 return sb.ToString();
Helps with common XML-related tasks.
static XmlWriterSettings WriterSettings(bool Indent, bool OmitXmlDeclaration)
Gets an XML writer settings object.
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
Abstract base class for node rules.
string SourceID
Source ID of sensor.
abstract void Export(XmlWriter Output)
Exports the rule.
CaseInsensitiveString JID
JID of sensor.
NodeRule()
Abstract base class for node rules.
string Partition
JID of sensor.
string ExportXml()
Exports the rule as an XML string.
string NodeID
Node ID of sensor.
Rule[] Rules
Applicable rules.
void AddChildRule(Rule Rule)
Adds a child rule.
Abstract base class for rules.
abstract void Export(XmlWriter Output)
Exports the rule.
TypeNameSerialization
How the type name should be serialized.