Пример #1
0
        //================================================================================
        private ProxyService SwapServiceEvents()
        {
            if (_service != null)
                _service.ByPassStateChanged -= OnServiceStateChanged;

            IByPasser clog = new HostReplaceBypasser(_targetHost, new LoggingBypasser(Client.LogData));
            IByPasser tlog = new LoggingBypasser(Target.LogData);

            //if (ClientShowASCII) clog = Client.LogData;
            //if (TargetShowASCII) tlog = Target.LogData;

            var service = new ProxyService(ListenPort, _targetHost, _targetPort, this, clog, tlog);
            service.SetIsSingleConnection(IsSingleConnection);
            service.SetLatency(this.DelayInt);
            service.ByPassStateChanged += OnServiceStateChanged;
            return service;
        }
Пример #2
0
 //================================================================================
 private void OnActionButtonClicked()
 {
     if (!IsRunning)
     {
         _service = SwapServiceEvents();
         _service.StartProxy();
         IsRunning = true; RaisePropertyChanged("ActionButtonText");
     }
     else
     {
         if (_service != null) _service.StopProxy();
         IsRunning = false; RaisePropertyChanged("ActionButtonText");
     }
 }