What Does the [Flags] Attribute Really Do?

前端 未结 6 1236
闹比i
闹比i 2020-12-06 03:58

What does applying [Flags] really do?

I know it modifies the behavior of Enum.ToString, but does it do anything else? (e.g. Different compiler or runtime behavior, e

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 04:49

    From an MSDN article:

    It is interesting to note that when Flags is specified, Parse and Format methods feature advanced capabilities.

    Likewise, the Parse method can successfully parse a comma-separated string like the one just shown into the proper numeric value.

提交回复
热议问题