private ReadElementString ( string localname, string ns ) : string | ||
localname | string | |
ns | string | |
return | string |
public virtual string ReadElementString(string localname, string ns)
{
string result = string.Empty;
if (MoveToContent() != XmlNodeType.Element)
{
throw new XmlException(SR.Xml_InvalidNodeType, this.NodeType.ToString(), this as IXmlLineInfo);
}
if (this.LocalName != localname || this.NamespaceURI != ns)
{
throw new XmlException(SR.Xml_ElementNotFoundNs, new string[2] { localname, ns }, this as IXmlLineInfo);
}
if (!this.IsEmptyElement)
{
//Read();
result = ReadString();
if (this.NodeType != XmlNodeType.EndElement)
{
throw new XmlException(SR.Xml_InvalidNodeType, this.NodeType.ToString(), this as IXmlLineInfo);
}
Read();
}
else
{
Read();
}
return result;
}
XmlReader::ReadElementString ( ) : string | |
XmlReader::ReadElementString ( string name ) : string |
public override void ReadXml(System.Xml.XmlReader reader) { if (reader.Name.Equals("Type")) { BusType = (EosBusType)Enum.Parse(typeof(EosBusType), reader.ReadElementString("Type")); } string port = reader.ReadElementString("Port"); if (!reader.IsEmptyElement) { reader.ReadStartElement("Boards"); while (reader.NodeType != XmlNodeType.EndElement) { reader.ReadStartElement("Board"); string name = reader.ReadElementString("Name"); byte address = byte.Parse(reader.ReadElementString("Address"), System.Globalization.CultureInfo.InvariantCulture); EosBoard board = new EosBoard(this, address, name); board.ReadXml(reader); reader.ReadEndElement(); _boards.Add(board); } reader.ReadEndElement(); } else { reader.Read(); } Port = port; }