Csharp/CSharp Tutorial/Development/BooleanSwitch

Материал из .Net Framework эксперт
Версия от 15:14, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Using Boolean Switch

<source lang="csharp">using System; using System.IO; using System.Diagnostics; class MainClass {

 static BooleanSwitch MySwitch = new BooleanSwitch("MyData", "MyModule");
 [STAThread]
 static void Main(string[] args)
 {
   MySwitch.Enabled = true;
   if (MySwitch.Enabled)
     Console.WriteLine("Error happened!");
 }

}</source>

Error happened!