Пример #1
0
 protected override void OnStop()
 {
     var proxy = new ProxyHandler();
     var threadHandler = new ThreadHandler();
     var installHandler = new InstallHandler();
     threadHandler.StopRequestThread();
     proxy.Stop();
     installHandler.Uninstall(true);
 }
Пример #2
0
 protected override void OnStart(string[] args)
 {
     var proxy = new ProxyHandler();
     var threadHandler = new ThreadHandler();
     var installHandler = new InstallHandler();
     proxy.Start();
     threadHandler.StartRequestThread();
     installHandler.Install();
 }
Пример #3
0
 private void proxyToggleBtn_Click(object sender, EventArgs e)
 {
     var proxy = new ProxyHandler();
     var threadHandler = new ThreadHandler();
     var installHandler = new InstallHandler();
     if (ProxyHandler.IsRunning)
     {
         threadHandler.StopRequestThread();
         proxy.Stop();
         installHandler.Uninstall(true);
         runProxyLbl.Text = @"Proxy not running";
     }
     else
     {
         proxy.Start();
         threadHandler.StartRequestThread();
         installHandler.Install();
         runProxyLbl.Text = @"Proxy running";
     }
 }
Пример #4
0
 private void exitBtn_Click(object sender, EventArgs e)
 {
     var installHandler = new InstallHandler();
     installHandler.Uninstall(false);
     Environment.Exit(Environment.ExitCode);
 }