【发布时间】:2010-02-18 09:31:44
【问题描述】:
与my previous question 相关。有没有办法在编译时阻止订阅?类似于在实现器中将事件的“添加”标记为“私有”,即使它在接口中是公开的。
【问题讨论】:
标签: c# events blocking subscriber
与my previous question 相关。有没有办法在编译时阻止订阅?类似于在实现器中将事件的“添加”标记为“私有”,即使它在接口中是公开的。
【问题讨论】:
标签: c# events blocking subscriber
您可以定义编译宏,并环绕#if 标记。
#if DEBUG
// do something only when we are launching Debug configuration
#endif
#if MYMACRO
// do something only when this macro is defined
#endif
【讨论】: