Questions tagged as 'enums'

1
answer

XSD For Class C # Enum

I'm generating a class with XSD.EXE from a schema. I am summarizing the posting only the part of the schema that generates the enum that I doubt. <xs:simpleType name="TCodUfIBGE"> <xs:annotation> <xs:documentation>...
asked by 21.09.2016 / 16:41
2
answers

Learning to use ENUM in Java

Good afternoon. I'm learning how to use enum types in Java and experiencing some problems. First, I created my enum as follows: public enum enumUpdateAction { NEW(0), CHANGE(1), DELETE(2), DELETE_THRU(3), DELETE_FROM(4)...
asked by 24.02.2017 / 18:04
2
answers

Sort List by Field String

I have a list with attributes, of which I have the field of evaluations, containing: Excellent, Good, Regular, Bad, and Poor. The information for this field I get from consuming a REST API using JSON. Example: IEnumerable<minhaEntidade...
asked by 04.06.2018 / 22:49
2
answers

How do I get an ENUM constant for the integer value?

I have an Enum that represents the months: public enum Mes { Janeiro, Fevereiro, Marco, ... } How do I get the full month's description of the month? Ex: Enter 12 and return December     
asked by 06.11.2017 / 18:24
1
answer

Create an enumerator in QML by C ++

I'm trying to use an enumerator that was created in C ++ and I'm using the QT 5.6 website itself to guide me, Data Type Conversion Between QML and C ++ . However when compiling I get the following compiler exception: error: undefined refere...
asked by 03.06.2016 / 16:27
1
answer

TEnum not identified in html

I created the following helper: public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null) { List<SelectListItem> lstEnum = AttributesHelper.ToSelectList<T...
asked by 28.06.2016 / 20:10
1
answer

Incompatible types when trying to start a class with the value of the "switch" of another Java

I have the following: public class Bullet { public enum Direcao { UP,DOWN,LEFT,RIGHT }; // Posição do tiro em pixels. private int x,y; // Direção do tiro. private Direcao direção; // Este tiro está ativo? private b...
asked by 30.10.2018 / 21:07
1
answer

Share enum of a web service with the client

I created a web service where you have enumerators to keep track of an integer attribute, I would like to know how I can access this enumerator from another project in which I am using this web service. Edit:     
asked by 14.03.2018 / 17:30
1
answer

Check if there is a value in the enumeration by the attribute and return its value

Is it possible to produce simpler code for this function without changing enum ? /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] public enum Velocidade { //...
asked by 02.10.2017 / 20:44
1
answer

Display Name with Razor

Do I have this case in my project? public enum TipoValorCalculoComissao { [Display(Name = "Percentual")] Percentual = 1, [Display(Name = "Valor")] Valor = 2 } And I would like to put these values in a combo, but I applied th...
asked by 03.06.2017 / 14:47