Amido.SystemEx.Xml.Linq.XElementExtensions.GetAttribute C# (CSharp) Method

GetAttribute() private static method

private static GetAttribute ( System.Xml.Linq.XElement element, string attributeName ) : System.Xml.Linq.XAttribute
element System.Xml.Linq.XElement
attributeName string
return System.Xml.Linq.XAttribute
        private static XAttribute GetAttribute(XElement element, string attributeName)
        {
            var x = element.Attribute(attributeName);
            if (x == null)
            {
                throw new InvalidOperationException(string.Format("Attribute {0} not found.", attributeName));
            }

            return x;
        }
    }