BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BrawlLib.Internal.ObjectExtension Class Reference

Static Public Member Functions

static string GetDisplayName< T > (this T obj)
 
static string GetDescription< T > (this T obj)
 

Member Function Documentation

◆ GetDescription< T >()

static string BrawlLib.Internal.ObjectExtension.GetDescription< T > ( this T  obj)
inlinestatic
16 {
17 var s = ((DescriptionAttribute) obj?.GetType().GetField(obj.ToString()).GetCustomAttributes(true)
18 .FirstOrDefault(a => a is DescriptionAttribute))?.Description ?? obj?.ToString() ?? string.Empty;
19 return s;
20 }

◆ GetDisplayName< T >()

static string BrawlLib.Internal.ObjectExtension.GetDisplayName< T > ( this T  obj)
inlinestatic
10 {
11 return ((DisplayNameAttribute) obj?.GetType().GetField(obj.ToString()).GetCustomAttributes(true)
12 .FirstOrDefault(a => a is DisplayNameAttribute))?.DisplayName ?? obj?.ToString() ?? string.Empty;
13 }

The documentation for this class was generated from the following file: