6 ms·
I've written my own wrapper for Enum.Parse that has _exactly_ the same structure as their Enum.TryParse. Glad to see that they're bumping into the same problem
by AndrewDucker 17y ago
I've written my own wrapper for Enum.Parse that has _exactly_ the same structure as their Enum.TryParse. Glad to see that they're bumping into the same problems internally that we do in the real world, and doing something about them.
- StrawberryFrog 17y agoYep, I have too. More than once. Once you have generics (C# 2.0 ) the way that enums are parsed in C# 1.0 just crying out for a simpler, type-safe wrapper. Once you have extension methods (C# 3.5) it's a good candidate for that.
- AndrewDucker 17y agoYup - I really wish that they'd had Generics from the beginning - there are numerous places where they would have made life better, which will never be changed.