Example #1
0
        private void OnElapsedTime(object source, ElapsedEventArgs e)
        {
            if (!processOpen())
            {
                if (IsInternetAvailable())
                {
                    InternetBlocker.block(true);
                }

                if (count % 15 == 0 && count > 3)
                {
                    showMessage("MMB Filtering Sysetm", "The system recognized that the main process was unexpectedly shut down. The Internet is disabled until the filtering system will be restart.");
                }

                count++;
            }
            else
            {
                if (scheduelBlock)
                {
                    if (IsInternetAvailable())
                    {
                        InternetBlocker.block(true);
                    }
                }
                else
                {
                    count = 15;
                    if (!IsInternetAvailable())
                    {
                        InternetBlocker.block(false);
                    }
                }
            }
        }
Example #2
0
 protected override void OnStop()
 {
     timer.Stop();
     timer.Enabled = false;
     InternetBlocker.block(false);
 }
 protected override void OnAfterUninstall(IDictionary savedState)
 {
     base.OnAfterUninstall(savedState);
     InternetBlocker.block(false);
 }