private static GetElement ( System.Xml.Linq.XElement element, string elementName ) : System.Xml.Linq.XElement | ||
element | System.Xml.Linq.XElement | |
elementName | string | |
return | System.Xml.Linq.XElement |
private static XElement GetElement(XElement element, string elementName)
{
var x = element.Descendants(elementName).FirstOrDefault();
if (x == null)
{
throw new InvalidOperationException(string.Format("Element {0} not found.", elementName));
}
return x;
}