Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public static Brush GetCategoryBackground(this SamplePage self)
        {
            string category = self.GetPageCategory();

            return(self.GetCategoryBackground(category));
        }