C# !Conditional attribute?

前端 未结 7 1316
既然无缘
既然无缘 2020-12-08 18:08

Does C# have a not Conditional (!Conditional, NotConditional, Conditional(!)) attribute?


i know C#

7条回答
  •  轮回少年
    2020-12-08 18:54

    Nope.

    Instead, you can write

    #if !ShowDebugString
    [Conditional("FALSE")]
    #endif
    

    Note that unlike [Conditional], this will be determined by the presence of the symbol in your assembly, not in your caller's assembly.

提交回复
热议问题