While the EnumSeparatePascalCase handles many situations it would be nice to be able to specify a substitution character like an underscore that could be used to insert spaces when displaying a enum. For example in our organization all departments are represented by a three character abbreviation and I have an enum that looks like:
Public Enum UserType
HRA_Employee
HSA_Employee
Other_County_Employee
Community_Partner
Contractor
Vendor
End Enum
Since I can’t separate all of them on PascalCase I end up inserting underscores. This works but it would make the application cleaner if I could easily eliminate the underscores when displaying the information.
Public Enum MyEnum <MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #1")> _ MyValue1 <MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #2")> _ MyValue2End Enum
And since you're a C# guy (I think )
public enum MyEnum{ [MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #1")] MyValue1}
You can also pass a second value to the attribute constructor that tells it that the first value is a localization key rather than a literal string for replacement.
Kinda - it is in the "What's New in Version 1.5" . I guess it was not enough of a hint. We added the feature in order to localize enums -- those darn Brazilians.
Good assumption.
-Larry
If you want to allow the text box to be editable, then you'll also need to handle the Parse event of the binding object to reverse the process of the format event handler.