I am used to C++ more than C#.
In C++ you have header files and you have the ability to declare states. For example, you can declare a series of unsigned integers to be for a variety of different states to later use in switch statements or if-then statements.
Since C# does not have the same sort of structure with header files, how would I impliment a simular functionality in C#?
The reason why I want to use UINT is because you can do that super cool bit-wise and and or with them. Remember those good ol' days? You could define four different conditions like this:
UINT state_001 2
UINT state_002 4
UINT state_003 8
UINT state_004 16
Then a variable can be any one state or any combination of states. To assign a variable a particular state, you do a bitwise and to the variable. To see if the variable was set to any of the states, you do a bitwise or.
How would that look like in Visual C#?

Guest UserPosted Jan 9, 2009, 11:13 AM
{
public const UInt32 state_001 = 2;
public const UInt32 state_002 = 4;
public const UInt32 state_003 = 8;
public const UInt32 state_004 = 16;
}
You can then reference the values as Globals.state_001, etc.
Declaring the class as "sealed" prevents other classes from inheriting Globals, so it may or may not be necessary for your environment.