Exemple #1
0
        public static string GetDescription(this ISetup setup)
        {
            Type type = setup.GetType();
            string result = null;

            SetupAttribute attr = type.GetCustomAttribute<SetupAttribute>();
            if(attr != null)
            {
                result = attr.Description;
            }

            return result;
        }
Exemple #2
0
        public static string[] GetLinks(this ISetup setup)
        {
            Type type = setup.GetType();
            string[] result = null;

            SetupAttribute attr = type.GetCustomAttribute<SetupAttribute>();
            if(attr != null)
            {
                result = attr.Links;
            }

            return result;
        }
Exemple #3
0
        public static string GetDisplayName(this ISetup setup)
        {
            Type type = setup.GetType();
            string result;

            SetupAttribute attr = type.GetCustomAttribute<SetupAttribute>();
            if(attr != null && attr.DisplayName != null)
            {
                result = attr.DisplayName;
            }
            else
            {
                result = type.Name;
            }

            return result;
        }