protected override void OnStart(string[] args) { var proxy = new ProxyHandler(); var threadHandler = new ThreadHandler(); var installHandler = new InstallHandler(); proxy.Start(); threadHandler.StartRequestThread(); installHandler.Install(); }
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"; } }