Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting Path of the Selected List View Item Pin
ravi_12174-Oct-06 21:55
ravi_12174-Oct-06 21:55 
QuestionCombining DataTable fields for Combobox (in DataGridView) DisplayMember Pin
drinkingbird4-Oct-06 18:54
drinkingbird4-Oct-06 18:54 
QuestionSystem::Byte, unsigned int and unsigned char? Pin
bankai1234-Oct-06 17:48
bankai1234-Oct-06 17:48 
AnswerRe: System::Byte, unsigned int and unsigned char? Pin
Christian Graus4-Oct-06 18:44
protectorChristian Graus4-Oct-06 18:44 
GeneralRe: System::Byte, unsigned int and unsigned char? Pin
bankai1234-Oct-06 18:51
bankai1234-Oct-06 18:51 
GeneralRe: System::Byte, unsigned int and unsigned char? Pin
Christian Graus4-Oct-06 18:58
protectorChristian Graus4-Oct-06 18:58 
GeneralRe: System::Byte, unsigned int and unsigned char? Pin
Insincere Dave5-Oct-06 4:30
Insincere Dave5-Oct-06 4:30 
Question...Interesting C# issue with XNA Pin
Alaric_4-Oct-06 17:34
professionalAlaric_4-Oct-06 17:34 
Hi...I'm trying to develop a generic "Bar" class inside XNA and thought I would investigate a method(development method....not a literal C# "method") of accomplishing this and was hoping that someone might be interested as well.

What I am wanting to do is pass an "OrientationString" through the constructor and conditionally compile the update methods based upon this string. (I know that I could accomplish this task through inheritance....but that's one of the reasons why I'm not doing it that way)

The functionality I desire is:
I know the following code will not work...please don't reply saying as such
because I already know that.  It is pseudocode


#undef HORIZONTAL
#undef VERTICAL
public Bar(int x, int y, string OrientationString)
{
   this.x = x;
   this.y = y;
   #if(OrientationString.ToUpper().Equals("VERTICAL"))
   {
     #define VERTICAL
   }
   #elif(OrientationString.ToUpper().Equals("HORIZONTAL"))
   {
     #define HORIZONTAL
   }
   
}
[Conditional("VERTICAL")]
public void UpdateVertical()
{
   ...
}
[Conditional("HORIZONTAL")]
public void Update HORIZONTAL
{
   ...
}


I basically want to control conditional compilation at run-time(*scratches head*......did I just say that?)
Does anyone know of a way to represent this logic in C#? I investigated the Attribute class but couldn't get very far with it.



-- modified at 23:58 Wednesday 4th October, 2006
AnswerRe: ...Interesting C# issue with XNA Pin
WillemM4-Oct-06 20:15
WillemM4-Oct-06 20:15 
AnswerRe: ...Interesting C# issue with XNA Pin
S. Senthil Kumar4-Oct-06 22:19
S. Senthil Kumar4-Oct-06 22:19 
AnswerRe: ...Interesting C# issue with XNA Pin
eggsovereasy5-Oct-06 4:25
eggsovereasy5-Oct-06 4:25 
QuestionRegular Expression Pin
Imtiaz Murtaza4-Oct-06 16:44
Imtiaz Murtaza4-Oct-06 16:44 
AnswerRe: Regular Expression Pin
Christian Graus4-Oct-06 18:45
protectorChristian Graus4-Oct-06 18:45 
AnswerRe: Regular Expression Pin
Guffa4-Oct-06 23:04
Guffa4-Oct-06 23:04 
AnswerRe: Regular Expression Pin
subrata.jana4-Oct-06 23:24
subrata.jana4-Oct-06 23:24 
AnswerRe: Regular Expression Pin
User 66585-Oct-06 1:31
User 66585-Oct-06 1:31 
QuestionControlling Application Volume in C# Pin
Brett Nottingham4-Oct-06 16:15
Brett Nottingham4-Oct-06 16:15 
AnswerRe: Controlling Application Volume in C# [edit] Pin
Edbert P4-Oct-06 16:50
Edbert P4-Oct-06 16:50 
Questionreading network binary data from LEFT or RIGHT? Pin
mmatteson4-Oct-06 14:40
mmatteson4-Oct-06 14:40 
Questionparse error [modified] Pin
Naji.A4-Oct-06 13:11
Naji.A4-Oct-06 13:11 
AnswerRe: parse error Pin
Christian Graus4-Oct-06 14:14
protectorChristian Graus4-Oct-06 14:14 
Questionc# won't display sub menuitems Pin
tmaung4-Oct-06 11:05
tmaung4-Oct-06 11:05 
QuestionLoading user controls from filename... Pin
Kasic Slobodan4-Oct-06 11:02
Kasic Slobodan4-Oct-06 11:02 
AnswerRe: Loading user controls from filename... Pin
Andrei Ungureanu4-Oct-06 23:35
Andrei Ungureanu4-Oct-06 23:35 
GeneralRe: Loading user controls from filename... Pin
Kasic Slobodan5-Oct-06 2:29
Kasic Slobodan5-Oct-06 2:29 

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.