WpfDataUi.DataUiGrid.GetCategoryFor C# (CSharp) Method

GetCategoryFor() private static method

private static GetCategoryFor ( MemberInfo memberInfo ) : string
memberInfo System.Reflection.MemberInfo
return string
        private static string GetCategoryFor(MemberInfo memberInfo)
        {
            var attributes = memberInfo.GetCustomAttributes(typeof(CategoryAttribute), true);

            string category = "Uncategorized";

            if (attributes != null && attributes.Length != 0)
            {
                CategoryAttribute attribute = attributes.FirstOrDefault() as CategoryAttribute;
                category = attribute.Category;
            }
            return category;
        }