Use the Conditional attribute with define
#define USE_METHOD_1
using System;
using System.Diagnostics;
class MainClass
{
[Conditional("USE_METHOD_1")]
public static void Method1()
{
Console.WriteLine("In Method 1");
}
public static void Main()
{
Console.WriteLine("In Main");
Method1();
}
}
Output In Main
In Method 1
|
HTML code for linking to this page:
Related in same category :
-
-
|