enum (2,860)

c# - Anyone know a good workaround for the lack of an enum generic constraint?
What I want to do is something like this: I have enums with combined flagged values. public static class EnumExtension{public static bool IsSet<T>( this T input, T matchTo)where T:enum//the constraint…
What does the[Flags] Enum Attribute mean in C#?
From time to time I see an enum like the following:[Flags] public enum Options{None=0, Option1=1, Option2=2, Option3=4, Option4=8}I don't understand what exactly the[Flags]-attribute does. Anyone have…
oop - Expression Evaluation and Tree Walking using polymorphism?(ala Steve Yegge)
This morning, I was reading Steve Yegge's: When Polymorphism Fails, when I came across a question that a co-worker of his used to ask potential employees when they came for their interview at Amazon.…
I need to validate an integer to know if is a valid enum value. What is the best way to do this in C#?…
I have a structure which I need to populate and write to disk(several actually). An example is: byte-6 bit0-original_or_copy bit1-copyright bit2-data_alignment_indicator bit3-PES_priority bit4-bit5-PE…
Convert a string to an enum in C#
What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value(which wil…
c# - Anyone know a quick way to get to custom attributes on an enum value?
This is probably best shown with an example. I have an enum with attributes: public enum MyEnum{[CustomInfo("This is a custom attrib")] None=0,[CustomInfo("This is another attrib")…
Importing C++ enumerations into C#
I'm currently working on creating a new C# project that needs to interact with an older C++ application. There is an error enumeration that already exists in the C++ app that I need to use in the C#…
python - Specifying a mySQL ENUM in a Django model
How do I go about specifying and using an ENUM in a Django model?…
I'm looking for a Java library for SWIFT messages. I want to parse SWIFT messages into an object model validate SWIFT messages(including SWIFT network validation rules) build/change SWIFT message…