Beispiel #1
0
 public static SuperTimer getInstance()
 {
     if (instance == null)
     {
         instance = new SuperTimer();
     }
     return(instance);
 }
        public MainWindow()
        {
            InitializeComponent();

            SuperTimer timer = SuperTimer.getInstance();

            //Http http = new Http();
            switch (http.HttpData("key", Config.key, Config.cookie))
            {
            case "key_yes":
                Config.license = "license_yes";
                timerHost.SetTimer(true);
                trayicon.trayicon.ShowBalloonTip(500, "Ninja Sefe Internet", "Защита включена", System.Windows.Forms.ToolTipIcon.Info);
                hosts.SaveHosts();
                Hide();
                break;

            case "key_no":
                Config.license = "license_no";
                timerHost.SetTimer(false);
                hosts.DeleteHosts();
                break;

            case "cookie_no":
                Config.license = "license_no";
                timerHost.SetTimer(false);
                hosts.DeleteHosts();
                trayicon.trayicon.ShowBalloonTip(500, "Ninja Sefe Internet", "Цей ключ вже використовується на іншому комп'ютері.", System.Windows.Forms.ToolTipIcon.Warning);
                break;

            default:
                if (Config.license == "license_yes")
                {
                    Hide();
                }
                break;
            }
        }