DSharpPlus.CommandsNext/CommandsNextExtension.cs
/// <summary>
/// Converts a type into user-friendly type name.
/// </summary>
/// <param name="t">Type to convert.</param>
/// <returns>User-friendly type name.</returns>
Converts a type into user-friendly type name.
Converts a type into user - friendly type name .
public string GetUserFriendlyTypeName(Type t)
        {
            if (this.UserFriendlyTypeNames.ContainsKey(t))
                return this.UserFriendlyTypeNames[t];
            var ti = t.GetTypeInfo();
            if (ti.IsGenericTypeDefinition && t.GetGenericTypeDefinition() == typeof(Nullable<>))
            {
                var tn = ti.GenericTypeArguments[0];
                if (this.UserFriendlyTypeNames.ContainsKey(tn))
                    return this.UserFriendlyTypeNames[tn];
                return tn.Name;
            }
            return t.Name;
        }
public string GetUserFriendlyTypeName ( Type t ) { if ( this . UserFriendlyTypeNames . ContainsKey ( t ) ) return this . UserFriendlyTypeNames [ t ] ; var ti = t . GetTypeInfo ( ) ; if ( ti . IsGenericTypeDefinition && t . GetGenericTypeDefinition ( ) == typeof ( Nullable < > ) ) { var tn = ti . GenericTypeArguments [ 0 ] ; if ( this . UserFriendlyTypeNames . ContainsKey ( tn ) ) return this . UserFriendlyTypeNames [ tn ] ; return tn . Name ; } return t . Name ; }
Converts a type into user-friendly type name.
Converts a type into user - friendly type name .
User-friendly type name.
User - friendly type name .
t
Type
Type to convert.
Type to convert .