0

Related to my previous question. Is there a way to block the subscription in compile time? Something like marking the event's "Add" as "private" in the implementor even though it's public in the interface.

Community
  • 1
  • 1
Moshe
  • 555
  • 3
  • 14

1 Answers1

1

You can define compile macros, and wrap around #if tag.

#if DEBUG
// do something only when we are launching Debug configuration
#endif

#if MYMACRO
// do something only when this macro is defined
#endif
Pentium10
  • 204,586
  • 122
  • 423
  • 502
  • I didn't understand how this answers my question. – Moshe Feb 18 '10 at 09:51
  • You can block the subscription in compile time if you tell the compiler to omit while doing the compile. For that you use an #if block, and you make use of a macro. This way if you setup the #if correctly the code inside it won't be compiled in the exe, as it was never written there. – Pentium10 Feb 18 '10 at 10:49