private void OnLogicallyConnected(object sender, EventArgs e) { this.Dispatcher.Invoke(new Action(() => { cb_targetIP.IsEnabled = false; bt_connect.IsEnabled = false; bt_disconnect.IsEnabled = true; string remoteAddr = cb_targetIP.Text; UsLogging.Printf(LogWndOpt.Bold, "connected to [u]{0}[/u].", remoteAddr); if (AppSettingsUtil.AppendAsRecentlyConnected(remoteAddr)) { cb_targetIP.Items.Add(remoteAddr); UsLogging.Printf("{0} is appended into the recent connection list.", remoteAddr); } // query switches and sliders { UsCmd cmd = new UsCmd(); cmd.WriteNetCmd(eNetCmd.CL_QuerySwitches); NetManager.Instance.Send(cmd); } { UsCmd cmd = new UsCmd(); cmd.WriteNetCmd(eNetCmd.CL_QuerySliders); NetManager.Instance.Send(cmd); } })); }
private void OnLogicallyConnected(object sender, EventArgs e) { this.Dispatcher.Invoke(new Action(() => { bt_connect.IsEnabled = false; bt_disconnect.IsEnabled = true; string remoteAddr = cb_targetIP.Text; UsLogging.Printf(LogWndOpt.Bold, "connected to [u]{0}[/u].", remoteAddr); if (AppSettingsUtil.AppendAsRecentlyConnected(remoteAddr)) { cb_targetIP.Items.Add(remoteAddr); UsLogging.Printf("{0} is appended into the recent connection list.", remoteAddr); } })); }