private void OnDisconnectEventHandler(object sender, object disconnectStatus) { ATCPConnector connector = sender as ATCPConnector; if (connector != null) { _traffic.UnSubscribe(_connector); if (_ntf != null) { _ntf.Invoke((MethodInvoker) delegate { _ntf.Close(); }); } connector.DisconnectEvent -= OnDisconnectEventHandler; } }
private void NCReceiveClientID(IConnector connector, ArgUniqueID arg) { if (arg == null) { return; } _netClient.ClientID = arg.UniqueID; NetLogger.Log("Login success, received client ID: " + arg.UniqueID); pnlFile.Invoke((MethodInvoker) delegate { pnlFile.Enabled = true; }); pnlTools.Invoke((MethodInvoker) delegate { pnlTools.Enabled = true; }); rbtnBrush.Invoke((MethodInvoker) delegate { rbtnBrush.Checked = true; }); if (_trafficForm != null) { _trafficForm.Invoke((MethodInvoker) delegate { _trafficForm.Text = "Client: " + _netClient.ClientID.ToString(); }); } }