Microsoft.Silverlight.Toolkit.Build.Tasks.DefaultStyle.GetAttribute C# (CSharp) Method

GetAttribute() private static method

Get the value of the first attribute that is defined.
private static GetAttribute ( System.Xml.Linq.XElement element ) : string
element System.Xml.Linq.XElement Element with the attributes defined.
return string
        private static string GetAttribute(XElement element, params string[] attributes)
        {
            foreach (string name in attributes)
            {
                string value =
                    (from a in element.Attributes()
                     where a.Name.LocalName == name
                     select a.Value)
                     .FirstOrDefault();
                if (name != null)
                {
                    return value;
                }
            }
            return "";
        }