Click here to Skip to main content
15,900,724 members
Home / Discussions / C#
   

C#

 
GeneralWin2k Socket Security Exception Pin
Tristan Rhodes10-Dec-04 21:10
Tristan Rhodes10-Dec-04 21:10 
QuestionDuplicated items in watch window ? Pin
sachinkalse10-Dec-04 18:23
sachinkalse10-Dec-04 18:23 
AnswerRe: Duplicated items in watch window ? Pin
Heath Stewart10-Dec-04 20:55
protectorHeath Stewart10-Dec-04 20:55 
GeneralBeta 2.0 limitations Pin
Yaakov Davis10-Dec-04 17:46
Yaakov Davis10-Dec-04 17:46 
GeneralRe: Beta 2.0 limitations Pin
Heath Stewart10-Dec-04 20:46
protectorHeath Stewart10-Dec-04 20:46 
GeneralRe: Beta 2.0 limitations Pin
Yaakov Davis10-Dec-04 22:22
Yaakov Davis10-Dec-04 22:22 
QuestionHow to Create static Enum like ConnectionState Pin
trevor_ledet10-Dec-04 15:21
trevor_ledet10-Dec-04 15:21 
AnswerRe: How to Create static Enum like ConnectionState Pin
Heath Stewart10-Dec-04 20:51
protectorHeath Stewart10-Dec-04 20:51 
I'm not sure I understand what you're asking, but you don't have to reference an enum through an object: in fact, System.Data.ConnectionState.Open includes no objects - only the namespace (System.Data), then the enum (ConnectionState), and finally the enum member (Open). It isn't like many C/C++ enums that are just #defines.

You declare an enum like so:
public enum MyEnum
{
  One,
  Two,
  Three
}
You can also assign specific values to each. If you want to use a flagged enumeration (so you can use bitwise operators on the enum members), attribute it with the FlagsAttribute and - to following naming guidelines to be consistent with the base class library (BCL) - make the enum plural:
[Flags]
public enum MyEnums
{
  One = 1,
  Two = 2,
  Four = 4
}
For more information about this, I highly suggest you read about the Visual C# Language[^], especially the Visual C# Language Specification[^].

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: How to Create static Enum like ConnectionState Pin
trevor_ledet11-Dec-04 5:52
trevor_ledet11-Dec-04 5:52 
GeneralMOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 15:19
Tyrus18210-Dec-04 15:19 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Skynyrd10-Dec-04 16:28
Skynyrd10-Dec-04 16:28 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 17:03
Tyrus18210-Dec-04 17:03 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Skynyrd10-Dec-04 17:07
Skynyrd10-Dec-04 17:07 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 17:15
Tyrus18210-Dec-04 17:15 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 17:14
Tyrus18210-Dec-04 17:14 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Skynyrd10-Dec-04 17:17
Skynyrd10-Dec-04 17:17 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 17:29
Tyrus18210-Dec-04 17:29 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 17:44
Tyrus18210-Dec-04 17:44 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Skynyrd10-Dec-04 19:10
Skynyrd10-Dec-04 19:10 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Tyrus18210-Dec-04 19:54
Tyrus18210-Dec-04 19:54 
GeneralRe: MOVING CHILD WINDOWS IN MDI Pin
Skynyrd11-Dec-04 2:08
Skynyrd11-Dec-04 2:08 
GeneralsqlCommand in C# Pin
John L. DeVito10-Dec-04 12:48
professionalJohn L. DeVito10-Dec-04 12:48 
GeneralRe: sqlCommand in C# Pin
Heath Stewart10-Dec-04 13:03
protectorHeath Stewart10-Dec-04 13:03 
GeneralCallContext SerializationException Pin
Skynyrd10-Dec-04 12:48
Skynyrd10-Dec-04 12:48 
GeneralRe: CallContext SerializationException Pin
Heath Stewart10-Dec-04 12:54
protectorHeath Stewart10-Dec-04 12:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.