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; }
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; }
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; }