Amido.SystemEx.Xml.Linq.XElementExtensions.SafeGetStringFromAttribute C# (CSharp) Метод

SafeGetStringFromAttribute() публичный статический Метод

public static SafeGetStringFromAttribute ( System.Xml.Linq.XElement element, string attributeName ) : string
element System.Xml.Linq.XElement
attributeName string
Результат string
        public static string SafeGetStringFromAttribute(XElement element, string attributeName)
        {
            XAttribute a = GetAttribute(element, attributeName);

            var result = string.Empty;

            if(a.Value != null)
            {
                result = a.Value;
            }

            return result;
        }

Same methods

XElementExtensions::SafeGetStringFromAttribute ( System.Xml.Linq.XElement element, string elementName, string attributeName ) : string