private void OnFtpConnectionEstablished() { ButtonConnectFtp.Invoke(new Action(() => { ButtonConnectFtp.Enabled = true; ButtonConnectFtp.Text = "Stop client"; ListboxLog.Items.Add("-- connection started --"); ListboxLog.SelectedIndex = ListboxLog.Items.Count - 1; })); FcHandshake HsCmd = new FcHandshake(); HsCmd.OnHandshakeReceived += OnHandshakeReceived; Service.PushNewCommand(HsCmd); }
private void OnFtpConnectionClosed(bool CleanShutdown) { ButtonConnectFtp.Invoke(new Action(() => { if (!CleanShutdown) { ButtonConnectFtp.Enabled = true; ButtonConfig.Enabled = true; } ButtonConnectFtp.Text = "Start client"; ListboxLog.Items.Add(CleanShutdown ? "-- connection ended --" : "-- connection failed --"); ListboxLog.SelectedIndex = ListboxLog.Items.Count - 1; Service = null; })); }