Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This define is only affect in this .cs file
- // Try global define if need to affect every .cs file
- #define ENABLE_FUNCTION
- using System;
- using System.Diagnostics;
- public static class Sample
- {
- public static void Test()
- {
- // This will be called only when ENABLE_FUNCTION defined.
- Print();
- }
- [Conditional("ENABLE_FUNCTION")]
- public static void Print()
- {
- Console.WriteLine("Print when ENABLE_FUNCTION defined.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement