Method Parse
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
Parse(string?)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(string? name)
Parameters
namestringThe case-sensitive string representation of the enumeration name or underlying value to convert
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(string?, bool)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(string? name, bool ignoreCase)
Parameters
namestringThe case-sensitive string representation of the enumeration name or underlying value to convert
ignoreCasebooltrue to read value in case insensitive mode; false to read value in case sensitive mode.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(string?, bool, bool)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(string? name, bool ignoreCase, bool allowMatchingMetadataAttribute)
Parameters
namestringThe case-sensitive string representation of the enumeration name or underlying value to convert
ignoreCasebooltrue to read value in case insensitive mode; false to read value in case sensitive mode.
allowMatchingMetadataAttributeboolIf true, considers the value included in metadata attributes such as
[Display]attribute when parsing, otherwise only considers the member names.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(string?, EnumParseOptions)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(string? name, EnumParseOptions options)
Parameters
namestringThe string representation of the enumeration name or underlying value to convert
optionsEnumParseOptionsOptions that control how the string value should be parsed.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(in ReadOnlySpan<char>)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(in ReadOnlySpan<char> name)
Parameters
nameReadOnlySpan<char>The case-sensitive string representation of the enumeration name or underlying value to convert
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(in ReadOnlySpan<char>, bool)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(in ReadOnlySpan<char> name, bool ignoreCase)
Parameters
nameReadOnlySpan<char>The case-sensitive string representation of the enumeration name or underlying value to convert
ignoreCasebooltrue to read value in case insensitive mode; false to read value in case sensitive mode.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(in ReadOnlySpan<char>, bool, bool)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(in ReadOnlySpan<char> name, bool ignoreCase, bool allowMatchingMetadataAttribute)
Parameters
nameReadOnlySpan<char>The case-sensitive string representation of the enumeration name or underlying value to convert
ignoreCasebooltrue to read value in case insensitive mode; false to read value in case sensitive mode.
allowMatchingMetadataAttributeboolIf true, considers the value included in EnumMemberAttribute attribute when parsing, otherwise only considers the member names.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name
Parse(in ReadOnlySpan<char>, EnumParseOptions)
Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.
public static DiscordPermission Parse(in ReadOnlySpan<char> name, EnumParseOptions options)
Parameters
nameReadOnlySpan<char>The string representation of the enumeration name or underlying value to convert
optionsEnumParseOptionsOptions that control how the string value should be parsed.
Returns
- DiscordPermission
An object of type DiscordPermission whose value is represented by
name