EnumFormattingOptions Enumeration

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public enum EnumFormattingOptions

Members

Auto0 Provides a similar formatting to the Enum.ToString method, though result is not guaranteed to be exactly the same if there are more defined names for the same value. The produced result will always be parseable by the System.Enum.Parse(Type, string) method as long as used separator is the comma character.
NonFlags1 The enum value is forced to be treated as a non-flags value. If there is no defined name for the current value, then a number is returned. This result is always parseable by the System.Enum.Parse(Type, string) method.
DistinctFlags2 The result will contain only names of single bit values. Missing names will be substituted by integers. Result will not be parseable by the System.Enum.Parse(Type, string) method if the string contains a non-standalone number. To parse such a result the Enum<TEnum>.Parse and Enum<TEnum>.TryParse overloads can be used.
CompoundFlagsOrNumber3 The result can contain either defined names (including compound ones, which do not represent single bits) or a single numeric value. This behavior is similar to the Enum.ToString method for a Flags enum and the result is always parseable by the System.Enum.Parse(Type, string) method as long as the separator is the comma character.
CompoundFlagsAndNumber4 The result can contain defined names (including compound ones, which do not represent single bits) and optionally also a numeric value if the result cannot be covered only by names. The result will not be parseable by the System.Enum.Parse(Type, string) method if a number was applied to the names. To parse such a result the Enum<TEnum>.Parse and Enum<TEnum>.TryParse overloads can be used.
Number5 The result is always a number, even if the value or flags has a named alternative.

See Also