Csharp/CSharp Tutorial/Development/BooleanSwitch

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Using Boolean Switch

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!");
  }
}
Error happened!