Csharp/C Sharp/Development Class/Attribute
Версия от 15:31, 26 мая 2010; (обсуждение)
Working with the Conditional Attribute
using System;
using System.Diagnostics;
public class TestClass
{
public void Method1()
{
Console.WriteLine("Hello from Method1!");
}
[Conditional("DEBUG")]
public void Method2()
{
Console.WriteLine("Hello from Method2!");
}
public void Method3()
{
Console.WriteLine("Hello from Method3!");
}
}
class MainClass
{
public static void Main()
{
TestClass MyTestClass = new TestClass();
MyTestClass.Method1();
MyTestClass.Method2();
MyTestClass.Method3();
}
}