void plcReconnected(DetectedPLC plc, bool newIP) { if (newIP) { plc.IP = plc.InternalIP; } DiscoverPLC.PLCbs.ResetBindings(false); PLCGrid.ClearSelection(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (lastSelectedRow == e.RowIndex) { PLCGrid.ClearSelection(); lastSelectedRow = -1; } else { lastSelectedRow = e.RowIndex; } }
private void FindPLCs() { Thread t = new Thread(delegate() { this.BeginInvoke(new Action(delegate() { PingTimer.Stop(); changeCursor(Cursors.WaitCursor); EnableButtons(false); DiscoverPLC.PLCbs.Clear(); DiscoverPLC.DiscoverPLCs(); changeCursor(Cursors.Default); EnableButtons(true); DiscoverPLC.PLCbs.ResetBindings(false); PLCGrid.ClearSelection(); PingTimer.Start(); })); lastSelectedRow = -1; }); t.Start(); this.ActiveControl = Discoverbtn; this.ActiveControl = null; }
void plcDisconnected(DetectedPLC plc) { DiscoverPLC.PLCbs.ResetBindings(false); PLCGrid.ClearSelection(); }