Questions tagged as 'enums'

1
answer

Convert enum variable to int in C #

I have the following code: enum type = { OPEN = 0, CLOSED, UNDEFINED}; list<int> frequencia = new list<int>(new int[] {0,0,0}); I would like to do the following operation: type t = enum.OPEN; frequencia[t]++; But I can not....
asked by 08.05.2014 / 19:04
1
answer

How to increment an enum in C?

Objectively how do I increment ++ or += 1 one of the variables of enum (the increment will be in a loop / switch ): enum {um = 0, dois = 0 ... seis = 0}; I read this question and I did not quite understand. Is...
asked by 22.03.2017 / 05:05
1
answer

How to change values of an enum within the code itself?

What I'm trying to do is that when I call an Enum, and instantiate it, it appears with value X, and when I'm messing with it in the code, it changes the value to whatever I want. > Example: //Classe dos enums public class Enumers{ public...
asked by 04.05.2014 / 21:54
1
answer

Index in an ENUM field can bring some advantage?

I was reading in a response from SOEN that fields in a table that have INDEX can optimize a query. Of course, as long as this query is known, such as a user search for the email field, for example. I have here a Person table t...
asked by 02.05.2016 / 13:53
1
answer

How to use an enumerator as an ItemSource of a ComboBox?

Assuming I have the following: enum Dias {Segunda, Terça, Quarta, Quinta, Sexta, Sábado, Domingo}; How can I use the enumerator Dias as ItemSource of a ComboBox in a WPF application? For example: <Combo...
asked by 23.09.2016 / 23:35
1
answer

How to display an item from an enum in my table using AngularJs?

I have a table where I make a ng-repeat , so far normal. <tr data-ng-repeat="item in itemsconfiguration"> <td>{{::item.Description}}</td> <td>{{::item.Order}...
asked by 29.09.2015 / 20:57
1
answer

Print enum field in JasperReports

I created a Enum that has a description field for each of your items. In my report in Jaspersoft Studio I want to print this description field and not name() of Enum . I created a field in the report, but when se...
asked by 04.03.2015 / 17:29
2
answers

Send Display Text of an Enum by Json

Well, I have an enum for the days of the week, being: Segunda = 2, [Display(Name="Terça")] Terca = 3, Quarta = 4, Quinta = 5, Sexta = 6, [Display(Name = "Sábado")] Sabado = 7 So I build an object that has a da...
asked by 19.01.2016 / 20:50
2
answers

Enum Value C #

I have a question regarding the following code snippet: public enum TipoPessoa { [System.Xml.Serialization.XmlEnumAttribute("1")] Fisica = 1, [System.Xml.Serialization.XmlEnumAttribute("2")] Juridica = 2 } or this: [System.Xml.Serializati...
asked by 21.09.2016 / 18:50
2
answers

Return Enum C #

I have the following enum: public enum TNFeInfNFeDetImpostoICMSICMS00CST { /// <remarks/> [System.Xml.Serialization.XmlEnumAttribute("00")] item00 = 00, } How do I "get" the value "00" of the enum in question? I alr...
asked by 20.09.2016 / 14:33