views:

25

answers:

1

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.

+1  A: 

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
I didn't understand how this answers my question.
Moshe
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