Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need Help getting bits from bytes. Pin
Ennis Ray Lynch, Jr.10-Feb-09 7:12
Ennis Ray Lynch, Jr.10-Feb-09 7:12 
AnswerRe: Need Help getting bits from bytes. Pin
Ravadre10-Feb-09 7:15
Ravadre10-Feb-09 7:15 
GeneralRe: Need Help getting bits from bytes. [modified] Pin
Muratus10-Feb-09 7:40
Muratus10-Feb-09 7:40 
GeneralRe: Need Help getting bits from bytes. Pin
Ravadre10-Feb-09 9:24
Ravadre10-Feb-09 9:24 
GeneralRe: Need Help getting bits from bytes. Pin
Muratus10-Feb-09 9:56
Muratus10-Feb-09 9:56 
GeneralRe: Need Help getting bits from bytes. Pin
Ravadre10-Feb-09 10:14
Ravadre10-Feb-09 10:14 
GeneralRe: Need Help getting bits from bytes. Pin
Muratus10-Feb-09 10:53
Muratus10-Feb-09 10:53 
AnswerRe: Need Help getting bits from bytes. [modified] Pin
#realJSOP10-Feb-09 9:59
mve#realJSOP10-Feb-09 9:59 
First, you need to learn about the <pre> tag so you can post your code correctly.

Second, what you want to do is this:

[Flags]
public enum OverlayTypes 
{    Public       = 0,
     OwnedByOther = 1,
     OwnedByGroup = 2,
     OwnedBySelf  = 4,
     ForSale      = 8,
     Auction      = 16,
     BorderWest   = 32,
     BorderSouth  = 64
}


Then, you can do something like this:

OverlayTypes types = OverlayTypes.OwnedBySelf | OverlayTypes.ForSale | OverlayTypes.BorderWest;
if ((types & OverlayTypes.OwnedBySelf) == OverlayTypes.OwnedBySelf)
{
    MessageBox.Show("Owned by self");
}


You could even do this:

OverlayTypes types = OverlayTypes.OwnedBySelf | OverlayTypes.ForSale | OverlayTypes.BorderWest;
OverlayTypes theseTypes = OverlayTypes.OwnedBySelf | OverlayTypes.BorderWest;
if ((types & theseTypes) == theseTypes)
{
    MessageBox.Show("Owned by self, and borders west");
}



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Tuesday, February 10, 2009 4:25 PM

AnswerRe: Need Help getting bits from bytes. Pin
Alan N10-Feb-09 14:59
Alan N10-Feb-09 14:59 
QuestionUpload file to sharepoint without/without sharepoint.dll Pin
Burdzy10-Feb-09 6:17
Burdzy10-Feb-09 6:17 
AnswerRe: Upload file to sharepoint without/without sharepoint.dll Pin
musefan10-Feb-09 6:28
musefan10-Feb-09 6:28 
GeneralRe: Upload file to sharepoint without/without sharepoint.dll Pin
Burdzy10-Feb-09 6:48
Burdzy10-Feb-09 6:48 
QuestionNetwork info Pin
Froz3n10-Feb-09 5:58
Froz3n10-Feb-09 5:58 
QuestionStreamReader.ReadLine() Pin
staticv10-Feb-09 5:19
staticv10-Feb-09 5:19 
AnswerRe: StreamReader.ReadLine() Pin
Dave Kreskowiak10-Feb-09 5:25
mveDave Kreskowiak10-Feb-09 5:25 
AnswerRe: StreamReader.ReadLine() Pin
Rob Philpott10-Feb-09 5:28
Rob Philpott10-Feb-09 5:28 
GeneralRe: StreamReader.ReadLine() [modified] Pin
staticv10-Feb-09 5:50
staticv10-Feb-09 5:50 
AnswerRe: StreamReader.ReadLine() Pin
Luc Pattyn10-Feb-09 7:08
sitebuilderLuc Pattyn10-Feb-09 7:08 
Question'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
abbd10-Feb-09 5:16
abbd10-Feb-09 5:16 
AnswerRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
Dave Kreskowiak10-Feb-09 5:23
mveDave Kreskowiak10-Feb-09 5:23 
GeneralRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
abbd10-Feb-09 6:05
abbd10-Feb-09 6:05 
GeneralRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
Dave Kreskowiak10-Feb-09 6:38
mveDave Kreskowiak10-Feb-09 6:38 
AnswerRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
Luc Pattyn10-Feb-09 7:12
sitebuilderLuc Pattyn10-Feb-09 7:12 
GeneralRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
abbd10-Feb-09 21:53
abbd10-Feb-09 21:53 
AnswerRe: 'WindowsApplication1.encode.Image' to 'System.Drawing.Image' Pin
Luc Pattyn11-Feb-09 0:06
sitebuilderLuc Pattyn11-Feb-09 0:06 

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.