In VS2008, you could write, for instance,
dim enumValue as MyEnum
enumValue =
.. and then as soon as you typed the =, you'd get a list of possible values of MyEnum.
With VS2010, you have to type
dim enumValue as MyEnum
enumValue = MyEnum.
... before getting the list on typing the final .
This makes for a lot more typing and seem...
Hello, dear programmers!
Please help with the next code:
typedef enum {a1, a2, a3} E;
template<E e>
int foo() {
return static_cast<int>(e);
}
class A {
A() {};
friend int foo<E e>();
};
The compiler says: error C2146: syntax erorr: missing "," before identifier "e"
I would be glad if someone could explain my mistake.
...
In this question, I use xor operator between enum with [Flags] attribute as following:
[Flags]
enum QueryFlag
{
None = 0x1,
ByCustomer = 0x2,
ByProduct = 0x4,
ByDate = 0x8
}
QueryFlag flags = QueryFlag.ByCustomer | QueryFlag.ByProduct;
To add an QueryFlag, of course we should use | operator.
flags |= QueryFlag.ByDate;
To re...
I have an entity, with a field of type enum, that is persisted as an integer in my database.
When retrieving objects from the database using ICriteria, I wish to restrict the results to those with the field being a member of a collection of enum values. Does Restrictions.In work with a collection of enums?
The following does not work. ...
Hi !
I want to pass for as a parameter for the GetValues method from MyItemSourceProvider a concrete value of MyEnum. How to write it please?
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type local:MyItemSourceProvider}">
<ObjectDataProvider.MethodParameters>
<!-- ENUM value (e.g. MyEnum.Record1) -->
...
Hi All,
I've found a couple of posts that describe similar scenarios to mine but nothing that has the same concept or has been resolved so I'm sure I will get complaints about this question but I still want to ask it so some of you more knowledgeable than my self can give me some advice.
My problem is hydrating a Viewmodel from a Lin...
Hi There,
I have about 20 div's in an aspx page. At any time, only one of them will be visible. I need to decide which div to show depending on the Query String.
http://...?mode=<ModeName>
The easy way would be to start with all div's invisible, then just put the QueryString in switch and write out cases for all the possible Mo...
I've spent a while trying to understand why my WPF app wasn't databinding to an enum property propertly and this is the cause.
static void Main(string[] args)
{
MyEnum x = 0;
Console.WriteLine(x.ToString());
Console.ReadLine();
}
public enum MyEnum
{
First = 1,
Second = 2
}
Essentially the problem was that there was n...
I'm having problems finding a general solution to deal with Enum fields on WPF and WCF, I need a little bit of help. Let's explain with an example:
When creating a person with a Sex enum value [Male, Female] I see three posibilites:
Male is default -> There are two posibilities but one is default. No problems binding the ComboBox....
I have HelpBoxes in my DB. those are messages people get on the site. each message has a receiver. either it's an organisation or a user, or both.
I have this Enum
public enum Ontvangers {
All = 'A',
Organisation = 'I',
User = 'D'
}
now in my index view
public ActionResult Index(string schooljaarp...
Consider the following two enums:
enum MyEnum1 {
Value1 = 1,
Value2 = 2,
Value3 = 3
}
enum MyEnum2 {
Value1 = 'a',
Value2 = 'b',
Value3 = 'c'
}
I can retrieve the physical value represented by these enum values through explicit casting, ((int)MyEnum1.Value2) == 2 or ((char)MyEnum2.Value2) == 'b', but what i...
I am trying to extract data from XML file and save it my C# class/object. My problem is
I have an XMl file like this
<personal_auto xmlns = "http://cp.com/rules/client">
<claim id = "s1" type = "Subject Section">
<report >
</report>
<policy>
</policy>
</claim>
<claim id = "s2" type = "Vehichle Section">
...
I have a VB6 project that references COMSVCSLib and one of the methods makes calls to COMSVCSLib's SharedPropertyGroupManager.CreatePropertyGroup passing LockMethod and Process as parameters.
Cleaned up VB6 code:
Dim groupName As String
Dim spmMgr As COMSVCSLib.SharedPropertyGroupManager
Dim spmGroup As COMSVCSLib...
Hi All
Ours is a Flex/Parsley/Blazeds/Spring project & I'm trying to implement java Enums in Actionscript3 and all I have to do is to send the Enum value to Spring service method.
The Java Enum Code (this is generated from XSD)
public enum ReferenceLookupType {
PATIENT_VISIT_TYPE("PATIENT_VISIT_TYPE"), PATIENT_STATUS(
...
Hi,
I am trying to write a generic function that will accept any enum, and put the values into a map for use in a drop down.
This is what I have so far, (for a specific enum), can my function enumToMap be rewritten generally to accept any enum type?
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import ...
Anyone knows the default value for enums using the default keywords as in:
MyEnum myEnum = default(MyEnum);
Would it be the first item?
...
Hi
I have a base class with the the following enum and property:
Public Enum InitType
Focus = 0
Help = 1
ErrorToolTip = 2
End Enum
Property ToolTipInitType() As InitType
Get
Return m_initType
End Get
Set(ByVal value As InitType)
m_initType = value
...
Hi,
I'm trying to inject java enum through spring context using
Here's what I've done. In my spring config, I've following entry
<util:constant id="Content"
static-field="com.test.taxonomy.model.MetadataTypeEnum.CONTENT_GROUP" />
Here, I'm trying to leverage an Enum ADSKContentGroup to be injected in my bean's (ADSK...
I want something like
enum EnumType {val1 = -1, val2 = 1};
enum EnumType2 {val1 = 1, val2 = -1};
In particular, val1 and val2 depend on the enumerated type--EnumType or EnumType2.
So I eventually want to be able to say something like
EnumType x = val1;
EnumType2 y = val1;
and have x and y have different values.
Is the foregoing p...
hi,
I am creating an api for a phonebook which has 3 different types of phone-numbers:FAX, HOME, WORK, CELL
I want to add a number to a specific type but do not want to classify FAX,HOME,WORK etc. as primitive types as I am considering that I could change it at a later date.
I was trying to use enums but am not clear how I can use it ...