From: Manish Agarwal on 13 Apr 2010 03:25 Is there anything similar to [Conditional("DEBUG")] attributes in csharp (http://msdn.microsoft.com/en-us/library/aa288458(VS.71).aspx) where I can supply a variable instead of "DEBUG" or other define. I have few methods which I want to call only when a global variable is true. something like if (myGlobalFlagOn) { // compute param1, param2, param3 here SomeObject.MethodCall(param1, param2, param3) } I don't want to use too many if conditions. I can have some wrapper functions which can internally check the state of the variable inside but in that case I need to always compute param1, param2, param3 parameters even if we are not going to use them. Regards, Manish
|
Pages: 1 Prev: CRT thread-safe when called from C-Sharp Next: How to do update sql in LinQ |