9月26日
Talking about Chris Smith's completely unique view : Neat nuggets of .NET - The Conditional attribute
Chris Smith's completely unique view : Neat nuggets of .NET - The Conditional attribute, offered a cool approach to easily compiling different versions of your app (i.e. Trial, Full, 10 user version, etc)
using System.Diagnostics;
[Conditional("DEBUG")]
static private void method1()
{
Console.WriteLine("This only works in DEBUG mode.");
}
[Conditional("custom")]
static private void method2()
{
Console.WriteLine("This only works when 'custom' is defined");
}