Пример #1
0
        public static string GetPageCategory(this SamplePage self)
        {
            var attr = self.GetType().GetTypeInfo().GetCustomAttribute(typeof(SamplePageAttribute)) as SamplePageAttribute;

            if (attr != null)
            {
                return(attr.Category);
            }
            return(string.Empty);
        }
Пример #2
0
        public static string GetPageCategory(this SamplePage self)
        {
            if (self == null)
            {
                throw new ArgumentNullException("self");
            }
            var attr = self.GetType().GetTypeInfo().GetCustomAttribute(typeof(SamplePageAttribute)) as SamplePageAttribute;

            if (attr != null)
            {
                return(attr.Category);
            }
            return(string.Empty);
        }
Пример #3
0
        public static Brush GetCategoryBackground(this SamplePage self)
        {
            string category = self.GetPageCategory();

            return(self.GetCategoryBackground(category));
        }