private void OnNotifyEvent(Agent agent, NotifyEvent ne, string msg) { this.SafeInvoke(() => { if (NotifyEvent.Connected == ne) { string logger = agent.ToString() + " 已连接"; this.statusStrip1.Items[1].Text = logger; Log.GetLogFile(Program.System).Log(logger); } else if (NotifyEvent.ConnectError == ne) { this.statusStrip1.Items[1].Text = msg; Log.GetLogFile(Program.System).Log(msg); } else if (NotifyEvent.ConnectToCountryCenter == ne) { // this.StartConnectCountryCenter(); this.listBox1.Items.Add(msg); Log.GetLogFile(Program.System).Log(msg); } else if (NotifyEvent.DisconnectToCountryCenter == ne) { // this.StopConnectCountryCenter(); this.listBox1.Items.Add(msg); Log.GetLogFile(Program.System).Log(msg); } }); }