I made a UserControl that has a Property of type RotateFlipType, this control is used within another UserControl that sets the property accordingly.
The thing is that according to RotateFlipType MSDN Documentation the Enum has 16 fields but VS Property Window only shows 14, Rotate180FlipNone and RotateNoneFlipX are missing.
I need to use Rotate180FlipNone. Setting it through the code works fine, but I really wouldn’t wanna do it like that.
Take a closer look at the values in the combo box. Note that it contains duplicates:
And yes, values are missing because of that. The list still contains 16 values.
The reason for this is that the enum values for RotateFlipType are ambiguous. There are only 8 distinct values. Like RotateNoneFlipNone is the exact same transformation as Rotate180FlipXY. Try it with a piece of paper. Or intuitively, there are 4 possible rotations multiplied by 2 possible projections (original and flipped). So what goes wrong is the type converter translating from the integral value of the enum (between 0 and 7) back to a string. There are two to choose from and it just picks the first match.
You’ll need to write your own TypeConverter to map a value to a different string, one of 8 possible strings. You may want to write a UITypeConverter so it is a bit more obvious with, say, a bitmap that shows the transformation.