c# - Is flags attribute necessary? -
i found or without flags attributes, can bit operation if defined following enum
enum testtype { none = 0x0, type1 = 0x1, type2 = 0x2 } i wondering why need flags attribute?
c# treat them same either way, c# isn't consumer:
propertygridrender differently allow combinationsxmlserializeraccept / reject delimited combinations based on flagenum.parselikewise (from string), , enum's.tostring()behave differently- lots of other code displays or processes value treat them differently
more importantly, though, expression of intent other developers (and code); this meant treated combinations, not exclusive values.
Comments
Post a Comment