Questions tagged as 'enums'

2
answers

Resource in an enum

I have enum and would like to change the Description with Resource: public enum SystemArea { [Description("Gestor")] Gestor = 3, [Description("Administrador")] Administrador = 2, [Description("Professor | Prof...
asked by 27.08.2015 / 19:46
2
answers

What is the difference between SET and ENUM in MySQL?

What are the differences between SET and ENUM in MySQL? And in which situations are both applied in the best way?     
asked by 28.09.2017 / 16:35
3
answers

When to use const and when to use #define

Since the two do the same function is there any difference between one and the other? I'll take the code from this site as an example C - Constants & Literals The #define Preprocessor #include <stdio.h> #define LENGTH 10...
asked by 22.06.2016 / 15:51
2
answers

What does an enum with the [Flags] attribute mean and how does it work?

I was seeing how the FileInfo class works and I came across an enum: [Serializable] [ComVisible(true)] [Flags] public enum FileAttributes { ReadOnly = 1, Hidden = 2, System = 4, Directory = 16, Archive = 32, Devi...
asked by 03.01.2014 / 19:13
2
answers

Cast problem in a generic method that receives an enum's array (enum [])

I want to make a generic method that gets a enum[] and returns a string representing the comma-separated array items. public static string ToSeparatedCommaString<T>(T[] enums) where T : struct, IComparable, IFormattable, I...
asked by 07.04.2015 / 18:27
1
answer

Enum as Object Value in DDD

After many searches on the internet, I came across many divergent opinions ... In my application, I created enum EstadoCivil {Casado = 1, Solteiro = 2, Divorciado = 3} . Can it be classified as an Object Value, or is it simply an enumer...
asked by 27.12.2017 / 12:13
2
answers

How to retrieve the description of an enumerator?

I have the following enumerator public enum MeuEnumerador { [Description("Descrição do item do enumerador")] Enumerador1 = 1, [Description("Outra descrição")] Enumerador2 = 2 } How do I get the value that is in the Descri...
asked by 20.11.2015 / 19:56
1
answer

How to display correct name in a bitwise enum?

I have the following enum marked as [Flag] , that is, they are values in bit [Flags] public enum Position { None, Left, Right, Both=3 } Sete for Both (both) position in 3 because if it is Left and...
asked by 13.04.2014 / 21:12
3
answers

Is there a naming pattern for enums?

I do not understand much of object naming pattern. I am creating a enum that enumerates positions, for example: manager, programmer, attendant ... Is there a standard to name this enum? EnumCargo , CargoEnum , ... ???    ...
asked by 17.07.2015 / 15:54
2
answers

How do I convert an enum type to list?

Is there any way to convert a Enum to List ? public enum TiposHospedagem { Casa = 1, Hotel = 2, Pousada = 3, CasaCampo = 4 } I'm trying to get enum and add to the list, but foreach does not want to...
asked by 31.08.2016 / 17:13