/// <summary> /// Extracts the attribute from an MemberInfo /// </summary> public static WmiMapAttribute Get(MemberInfo info) { return((WmiMapAttribute)WmiMapAttribute.GetCustomAttribute(info, typeof(WmiMapAttribute))); }
/// <summary> /// Extracts the membername /// </summary> public static string ConvertMemberName(MemberInfo info) { WmiMapAttribute memberAttribute = WmiMapAttribute.Get(info); return(memberAttribute != null ? memberAttribute.Name : info.Name); }
/// <summary> /// Retrieves the attribute from an type /// </summary> public static WmiMapAttribute Get(Type type) { return((WmiMapAttribute)WmiMapAttribute.GetCustomAttribute(type, typeof(WmiMapAttribute))); }
/// <summary> /// Extracts the table name /// </summary> public static string ConvertTableName(Type type) { WmiMapAttribute memberAttribute = WmiMapAttribute.Get(type); return(memberAttribute != null ? memberAttribute.Name : type.Name); }