The TextWrapping property of the TextBox has three possible values:
Wrap
NoWrap
WrapWithOverflow
I would like to bind to the IsChecked property of a MenuItem. If the MenuItem is checked, I want to set the TextWrapping property of a TextBox to Wrap. If the MenuItem is not checked, I want to set the TextWrapping property of the TextB...
I have an interface - here's a nicely contrived version as an example:
public interface Particle {
enum Charge {
POSITIVE, NEGATIVE
}
Charge getCharge();
double getMass();
etc...
}
Is there any difference in how implementations of this would behave if I defined the Charge enum as static - i.e. does this...
Hi,
Is there a way to persist an enum to the DB using NHibernate? That is have a table of both the code and the name of each value in the enum.
I want to keep the enum without an entity, but still have a foreign key (the int representation of the enum) from all other referencing entities to the enum's table.
...
If I have a table like this:
CREATE TABLE sizes (
name ENUM('small', 'medium', 'large')
);
Is MySQL going to store those strings in every row, or internally will it use something smaller like integers to know which enum value to refer to?
I want to use an enum in a table but I'm worried if it's as wasteful as storing a string in ...
Is it possible to define an implicit conversion of enums in c#?
something that could achieve this?
public enum MyEnum
{
one = 1, two = 2
}
MyEnum number = MyEnum.one;
long i = number;
Edit:
If not, why not!! :)
...
I just noticed that you can not use standard math operators on an enum such as ++ or +=
So what is the best way to iterate through all of the values in a C++ enum?
...
I'm working on a project and I want to store some easily enumerated information in a table. MySql's enum data type does exactly what I want: http://dev.mysql.com/doc/refman/5.0/en/enum.html . Is there an equivalent in SQL Server 2005?
I know I could store the possible values in a type table with a key, but I'd rather not have to link ...
For example:
Base class header file has:
enum FOO
{
FOO_A,
FOO_B,
FOO_C,
FOO_USERSTART
};
Then the derived class has:
enum FOO
{
FOO_USERA=FOO_USERSTART
FOO_USERB,
FOO_USERC
};
Just to be clear on my usage it is for having an event handler where the base class has events and then derived classes can add events. The derived classes...
In vs2008, is it possible to write an extension methods which would apply to any enumeration.
I know you can write extension methods against a specific enumeration, but I want to be able to every enumeration using a single extension method. Is this possible?
...
I've been reading through the details of the System libraries set and get methods yet the parameters are usually Strings.
Would you consider the use of String as parameters bad practise since the inclusion of enum?
A better alternative at minimum might be public final String, No?
...
I remember from way back at university using a switch with 'binary search' or 'binary switch'. Something like that, My google foo is broken today. Anyway it goes down like this: You define an array of possible options (Strings usually), some magic happens, and those options in the array become the cases in the switch happens. I do rememb...
What is the preferred syntax for defining enums in JavaScript? Something like:
my.namespace.ColorEnum = {
RED : 0,
GREEN : 1,
BLUE : 2
}
// later on
if(currentColor == my.namespace.ColorEnum.RED) {
// whatever
}
Or is there a more preferable idiom?
...
I have a number of user permissions that are tested throughout my ASP.NET application. These permission values are referenced in an Enum so that I can conveniently test permissions like so:
btnCreate.Enabled = PermissionManager.TestPermission(Permission.AllowCreate);
However, I also have these permissions stored in the database becau...
Criteria: Performance, Performance, Performance.
I need a way to convert a uint, int, etc into it's enum equivalent. What's the fastest way I can do that using C#?
...
In designing a class for customer for example would it make sense to use an Enum for CustomerType?
...
I have an enumeration: ENUM( 'alpha', 'beta', 'gamma', 'delta', 'omega' )
If I sort my table by this column I get them in the correct order defined above.
However, I can't find a way to select a subset of these, e.g. everything before delta. Using WHERE status < 'delta' only returns alpha and beta, not gamma. It seems MySQL uses a stri...
Hi there,
I have my enumHelper class that contains these:
public static IList<T> GetValues()
{
IList<T> list = new List<T>();
foreach (object value in Enum.GetValues(typeof(T)))
{
list.Add((T)value);
}
return list;
}
and
public static string Description(Enum value)
{
Attribute DescAttribute = LMIGHelper.GetAttribute(v...
I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having.
In a header somewhere:
enum SpecificIndexes{
//snip
INVALID_INDEX = -1
};
Then later - initialization:
nextIndex = INVALID_INDEX;
and use
if(nextIndex != INVALID_INDEX)
{
//do stuff
}
Debugging the code, t...
I have an enum construct like this:
public enum EnumDisplayStatus
{
None=1,
Visible=2,
Hidden=3,
MarkedForDeletion=4
}
In my database, the enumerations are referenced by value. My question is, how can i turn the number representation of the enum, back to the string name. for example, given '2' the result should be ...
I'm using Windows Forms and VS2008. I want to store an enum value in my application's settings file.
The settings editor in VS2008 only gives me a limited set of types. Amazingly, enums don't seem to be one of these types that are automatically supported - have I understood this correctly?
From reading up on the subject, it seems lik...