예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            SetRequestUrl();

            bw.WorkerReportsProgress = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            clientSocket = new ClientSocket(this);
            clientSocket.SocketResponseReceived += (sock, args) => Dispatcher.Invoke(new Action(() => ReceiveConfigMessage(args.Message)));
            clientSocket.SocketDisconnected += (sock, args) => Dispatcher.Invoke(new Action(()
                =>
                {
                    gbRemoteConf.Header = "Remote config";
                    gbRemoteConf.IsEnabled = false;
                }));
            clientSocket.SocketConnected += (sock, args) => Dispatcher.Invoke(new Action(()
                =>
                {
                    gbRemoteConf.Header = string.Format("Remote config {0}:{1}", clientSocket.Ip, clientSocket.Port);
                    gbRemoteConf.IsEnabled = true;
                }));

            savedConfigValues.Add(ConfigType.MaxWorkerThreads, -1);
            savedConfigValues.Add(ConfigType.MaxIOThreads, -1);
            savedConfigValues.Add(ConfigType.MaxConnections, -1);
            savedConfigValues.Add(ConfigType.AvailableIOThreads, -1);
            savedConfigValues.Add(ConfigType.AvailableWorkerThreads, -1);
            savedConfigValues.Add(ConfigType.RequestQueueLimit, -1);
            savedConfigValues.Add(ConfigType.ParallelDistantRequestValue, -1);
            savedConfigValues.Add(ConfigType.MinWorkerThreads, -1);
            savedConfigValues.Add(ConfigType.MinIOThreads, -1);
            savedConfigValues.Add(ConfigType.Timeout, -1);
            savedConfigValues.Add(ConfigType.ReadWriteTimeout, -1);
        }
 public ConnectWindow(ClientSocket _clientSocket, ILogger _logger)
 {
     clientSocket = _clientSocket;
     logger = _logger;
     InitializeComponent();
 }