Click here to Skip to main content
15,923,789 members
Home / Discussions / C#
   

C#

 
GeneralRe: Custom control's properties that can be bound to Pin
Heath Stewart15-Dec-03 8:31
protectorHeath Stewart15-Dec-03 8:31 
GeneralRe: Custom control's properties that can be bound to Pin
leppie15-Dec-03 8:53
leppie15-Dec-03 8:53 
QuestionHow to compile C# documentation text (tags summary, param, returns) Pin
Vasek15-Dec-03 7:05
Vasek15-Dec-03 7:05 
AnswerRe: How to compile C# documentation text (tags summary, param, returns) Pin
Heath Stewart15-Dec-03 8:33
protectorHeath Stewart15-Dec-03 8:33 
GeneralRe: How to compile C# documentation text (tags summary, param, returns) Pin
David Stone15-Dec-03 8:35
sitebuilderDavid Stone15-Dec-03 8:35 
GeneralRe: How to compile C# documentation text (tags summary, param, returns) Pin
Vasek15-Dec-03 8:44
Vasek15-Dec-03 8:44 
GeneralRe: How to compile C# documentation text (tags summary, param, returns) Pin
Heath Stewart15-Dec-03 8:46
protectorHeath Stewart15-Dec-03 8:46 
AnswerRe: How to compile C# documentation text (tags summary, param, returns) Pin
David Stone15-Dec-03 8:34
sitebuilderDavid Stone15-Dec-03 8:34 
GeneralRe: How to compile C# documentation text (tags summary, param, returns) Pin
Member 26118815-Dec-03 22:12
Member 26118815-Dec-03 22:12 
GeneralSaving application options Pin
blakeb_115-Dec-03 5:54
blakeb_115-Dec-03 5:54 
GeneralRe: Saving application options Pin
Not Active15-Dec-03 6:16
mentorNot Active15-Dec-03 6:16 
GeneralRe: Saving application options Pin
Nick Parker15-Dec-03 6:30
protectorNick Parker15-Dec-03 6:30 
GeneralReference to a reference Pin
balkanese15-Dec-03 4:44
balkanese15-Dec-03 4:44 
GeneralRe: Reference to a reference Pin
Colin Angus Mackay15-Dec-03 8:27
Colin Angus Mackay15-Dec-03 8:27 
GeneralRe: Reference to a reference Pin
balkanese15-Dec-03 21:07
balkanese15-Dec-03 21:07 
Generalmissing config file Pin
pallattila15-Dec-03 4:22
pallattila15-Dec-03 4:22 
GeneralRe: missing config file Pin
Heath Stewart15-Dec-03 4:29
protectorHeath Stewart15-Dec-03 4:29 
GeneralRe: missing config file Pin
Uwe Keim15-Dec-03 7:44
sitebuilderUwe Keim15-Dec-03 7:44 
GeneralCustom Panel Control Question. Pin
YetAnotherDeveloper15-Dec-03 3:58
YetAnotherDeveloper15-Dec-03 3:58 
GeneralRe: Custom Panel Control Question. Pin
Heath Stewart15-Dec-03 4:26
protectorHeath Stewart15-Dec-03 4:26 
GeneralApp monitoring Pin
Callixte.15-Dec-03 3:43
Callixte.15-Dec-03 3:43 
GeneralRe: App monitoring Pin
Nick Parker15-Dec-03 3:49
protectorNick Parker15-Dec-03 3:49 
GeneralRe: App monitoring Pin
Uwe Keim15-Dec-03 7:48
sitebuilderUwe Keim15-Dec-03 7:48 
GeneralFlags Enums Pin
Member 26118815-Dec-03 0:17
Member 26118815-Dec-03 0:17 
This is propably a question from which everyone should know the answer, but I want to ask it anyway. Poke tongue | ;-P

If I have an enum, like this:
[Flags]
public enum ThisIsAnEnum
{
    None,
    FirstFlag,
    SecondFlag,
    ThirdFlag,
    FourthFlag
}

How do I test whether a specific value is used?

Is this the proper way?
ThisIsAnEnum enumValue = ThisIsAnEnum.SecondFlag | ThisIsAnEnum.FourthFlag;

if (enumValue & ThisIsAnEnum.SecondFlag != 0)
{
    // Do something...
}

Or is there some method like Flags.Match(), but for a bitfield value?

And why do I have to add the values of the enum to it's members? Like this:
[Flags]
public enum ThisIsAnEnum
{
    None = 0,
    FirstFlag = 1,
    SecondFlag = 2,
    ThirdFlag = 4,
    FourthFlag = 8
}


If I don't, their values will be 0, 1, 2, 3, 4, 5, 6..., and not 0, 1, 2, 4, 8, 16... .

Thanks in advance,

- Daniël Pelsmaeker



The earth is not dying. it is being killed...
GeneralRe: Flags Enums Pin
Heath Stewart15-Dec-03 4:21
protectorHeath Stewart15-Dec-03 4:21 

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.