Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
AnswerRe: Passing struct data from 1 form to another form Pin
#realJSOP2-May-08 7:26
mve#realJSOP2-May-08 7:26 
QuestionCreating Reuseable Classes Pin
Jammer2-May-08 6:04
Jammer2-May-08 6:04 
AnswerRe: Creating Reuseable Classes Pin
carbon_golem2-May-08 6:37
carbon_golem2-May-08 6:37 
GeneralRe: Creating Reuseable Classes Pin
Jammer2-May-08 7:26
Jammer2-May-08 7:26 
AnswerRe: Creating Reuseable Classes Pin
Jason McBurney2-May-08 8:51
Jason McBurney2-May-08 8:51 
QuestionC# Classes in DLL files Pin
Cozmo232-May-08 5:49
Cozmo232-May-08 5:49 
AnswerRe: C# Classes in DLL files Pin
Judah Gabriel Himango2-May-08 6:30
sponsorJudah Gabriel Himango2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
Abhijit Jana2-May-08 6:30
professionalAbhijit Jana2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
#realJSOP2-May-08 6:30
mve#realJSOP2-May-08 6:30 
AnswerRe: C# Classes in DLL files Pin
Cozmo232-May-08 7:49
Cozmo232-May-08 7:49 
GeneralRe: C# Classes in DLL files Pin
Jason McBurney2-May-08 9:22
Jason McBurney2-May-08 9:22 
GeneralRe: C# Classes in DLL files Pin
Cozmo235-May-08 3:12
Cozmo235-May-08 3:12 
QuestionDateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 4:11
buchstaben2-May-08 4:11 
AnswerRe: DateTime, DayOfWeek in range comparison Pin
Urs Enzler2-May-08 4:22
Urs Enzler2-May-08 4:22 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 4:28
buchstaben2-May-08 4:28 
QuestionRe: DateTime, DayOfWeek in range comparison Pin
Spacix One2-May-08 4:54
Spacix One2-May-08 4:54 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
buchstaben2-May-08 5:19
buchstaben2-May-08 5:19 
AnswerRe: DateTime, DayOfWeek in range comparison [modified] Pin
#realJSOP2-May-08 6:35
mve#realJSOP2-May-08 6:35 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 7:39
mvePIEBALDconsult2-May-08 7:39 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 7:45
mve#realJSOP2-May-08 7:45 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 8:15
mve#realJSOP2-May-08 8:15 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 8:46
mvePIEBALDconsult2-May-08 8:46 
AnswerRe: DateTime, DayOfWeek in range comparison Pin
PIEBALDconsult2-May-08 7:28
mvePIEBALDconsult2-May-08 7:28 
GeneralRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 7:43
mve#realJSOP2-May-08 7:43 
AnswerRe: DateTime, DayOfWeek in range comparison Pin
#realJSOP2-May-08 8:10
mve#realJSOP2-May-08 8:10 
Ignore my first post. This is the best way (notice no bizarre culture crap going on):

DayOfWeek from = DayOfWeek.Thursday;
DayOfWeek to   = DayOfWeek.Tuesday;

DayOfWeek currentDay = DayOfWeek.Wednesday;

bool inRange = (currentDay >= from || currentDay <= to);


Notice that I'm using OR instead of AND. If you make currentDay Wednesday, inRange will be false. If you make it any other day, it will be true.

It's kind of pointless to do a Sunday-Saturday (or similar) comparison because any date will fall into the range. BTW, the comparison above also works for from=Saturday and to=Sunday.


"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


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.