"G" or "g" |
If value is equal to a named enumerated constant, the name of that constant is returned; otherwise, the decimal equivalent of value is returned.
For example, suppose the only enumerated constant is named, Red, and its value is 1. If value is specified as 1, then this format returns "Red". However, if value is specified as 2, this format returns "2".
-or-
If the FlagsAttribute custom attribute is applied to the enumeration, then value is treated as a bit field that contains one or more flags that consist of one or more bits.
If value is equal to a combination of named enumerated constants, a delimiter-separated list of the names of those constants is returned. value is searched for flags, going from the flag with the largest value to the smallest value. For each flag that corresponds to a bit field in value, the name of the constant is concatenated to the delimiter-separated list. Then the value of that flag is excluded from further consideration, and the search continues for the next flag.
If value is not equal to a combination of named enumerated constants, the decimal equivalent of value is returned.
|
"F" or "f" |
Treats value as a bit field. If value is equal to a combination of named enumerated constants, a delimiter-separated list of the names of those constants is returned. Parameter value is searched for flags, going from the flag with the largest value to the smallest value. For each flag that corresponds to a bit field in value, the name of the constant is concatenated to the delimiter-separated list. Then the value of that flag is excluded from further consideration, and the search continues for the next flag.
If value is not equal to a combination of named enumerated constants, the decimal equivalent of value is returned.
|