11 private readonly XmlElement rootElement;
12 private XmlElement stanzaElement =
null;
13 private readonly
string xml;
14 private string content;
15 private readonly
int contentStart;
16 private readonly
int contentLen;
25 public Stanza(XmlElement RootElement,
string Xml,
int ContentStart,
int ContentLen)
27 this.rootElement = RootElement;
29 this.contentStart = ContentStart;
30 this.contentLen = ContentLen;
42 this.rootElement = RootElement;
46 this.contentStart = -1;
57 if (this.content is
null)
59 if (this.contentStart < 0)
63 this.content =
string.Empty;
65 this.content = E.InnerXml;
67 else if (this.contentLen <= 0)
68 this.content =
string.Empty;
70 this.content = this.xml.Substring(this.contentStart, this.contentLen);
84 if (!(this.content is
null))
85 return !
string.IsNullOrEmpty(this.content);
87 if (this.contentStart < 0)
94 foreach (XmlNode N
in E.ChildNodes)
103 else if (this.contentLen <= 0)
117 if (this.stanzaElement is
null)
119 foreach (XmlNode N
in this.rootElement.ChildNodes)
121 if (N is XmlElement E)
123 this.stanzaElement = E;
129 return this.stanzaElement;
Contains information about a stanza.
Stanza(XmlElement RootElement, XmlElement StanzaElement, string Xml)
Contains information about a stanza.
string Content
Literal XML content.
XmlElement StanzaElement
Stanza element.
bool HasContent
If the stanza has content.
Stanza(XmlElement RootElement, string Xml, int ContentStart, int ContentLen)
Contains information about a stanza.