Here are the examples of the csharp api class hdsdump.f4m.XmlNodeEx.GetChildNode(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
6 Examples
0
1. Example
View licensepublic string GetText(string childNodeName) { XmlNode childNode = GetChildNode(childNodeName); if (childNode != null) { return childNode.InnerText.Trim(); } return string.Empty; }
0
2. Example
View licensepublic int GetChildNodeAttributeInt(string childNodeName, string attributeName, int defaultValue = 0) { int resultValue = defaultValue; XmlNode childNode = GetChildNode(childNodeName); if (childNode != null) { string strValue = childNode.Attributes?[attributeName]?.Value; int.TryParse(strValue, out resultValue); } return resultValue; }
0
3. Example
View licensepublic byte[] GetData(string childNodeName) { XmlNode childNode = GetChildNode(childNodeName); if (childNode != null) return Convert.FromBase64String(childNode.InnerText.Trim()); return null; }
0
4. Example
View licensepublic int GetInt(string childNodeName, int defaultValue = 0) { int valueInt = defaultValue; XmlNode childNode = GetChildNode(childNodeName); if (childNode != null) { string val = childNode.InnerText.Trim(); int.TryParse(val, out valueInt); } return valueInt; }
0
5. Example
View licensepublic float GetFloat(string childNodeName, float defaultValue = 0) { float valueInt = defaultValue; XmlNode childNode = GetChildNode(childNodeName); if (childNode != null) { string val = childNode.InnerText.Trim(); float.TryParse(val, out valueInt); } return valueInt; }
0
6. Example
View licensepublic DateTime GetDateTime(string childNodeName) { XmlNode childNode = GetChildNode(childNodeName); DateTime result = new DateTime(); if (childNode != null) { string val = childNode.InnerText.Trim(); DateTime.TryParseExact(val, Rfc3339, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal, out result); } return result; }