コード例 #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
 public static void Start()
 {
     if (!File.Exists(ConfigurationManager.AppSettings["xmlDocumentLocation"]))
     {
         Directory.CreateDirectory(@"C:\proxy\cache");
         new XDocument(new XElement("Resources")).Save(ConfigurationManager.AppSettings["xmlDocumentLocation"]);
     }
     var connectionHandler = new ConnectionHandler();
     connectionHandler.SetupTcp();
     connectionHandler.SetupUdp();
     connectionHandler.SendNewHostSignal();
     var threadHandler = new ThreadHandler();
     threadHandler.StartNewHostThread();
 }
コード例 #4
0
        public static void Start()
        {
            if (!File.Exists(ConfigurationManager.AppSettings["xmlDocumentLocation"]))
            {
                Directory.CreateDirectory(@"C:\proxy\cache");
                new XDocument(new XElement("Resources")).Save(ConfigurationManager.AppSettings["xmlDocumentLocation"]);
            }
            var connectionHandler = new ConnectionHandler();

            connectionHandler.SetupTcp();
            connectionHandler.SetupUdp();
            connectionHandler.SendNewHostSignal();
            var threadHandler = new ThreadHandler();

            threadHandler.StartNewHostThread();
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: cdtlaurence/DistributedProxy
 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";
     }
 }