10 private readonly XmlElement rootElement;
11 private XmlElement stanzaElement =
null;
12 private readonly
string xml;
13 private string content;
14 private readonly
int contentStart;
15 private readonly
int contentLen;
24 public Stanza(XmlElement RootElement,
string Xml,
int ContentStart,
int ContentLen)
26 this.rootElement = RootElement;
28 this.contentStart = ContentStart;
29 this.contentLen = ContentLen;
41 this.rootElement = RootElement;
45 this.contentStart = -1;
56 if (this.content is
null)
58 if (this.contentStart < 0)
62 this.content =
string.Empty;
64 this.content = E.InnerXml;
66 else if (this.contentLen <= 0)
67 this.content =
string.Empty;
69 this.content = this.xml.Substring(this.contentStart, this.contentLen);
83 if (!(this.content is
null))
84 return !
string.IsNullOrEmpty(this.content);
86 if (this.contentStart < 0)
93 foreach (XmlNode N
in E.ChildNodes)
102 else if (this.contentLen <= 0)
116 if (this.stanzaElement is
null)
118 foreach (XmlNode N
in this.rootElement.ChildNodes)
120 if (N is XmlElement E)
122 this.stanzaElement = E;
128 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.