private void lsbClients_MouseDoubleClick(object sender, MouseEventArgs e) { foreach (MonServer server in serverObjects) { string serverIP = ""; for (int i = 0; i < server.IPaddr.Length - 1; i++) { serverIP += server.IPaddr[i] + "."; } serverIP += server.IPaddr[server.IPaddr.Length - 1]; if (serverIP.Equals(lsbClients.SelectedItem.ToString())) { AuditForm auditLogForm = new AuditForm(server); auditLogForm.Show(); } } }
/// <summary> /// Обработчик двойного клика на списке компьютеров /// </summary> private void PCListView_DoubleClick(object sender, EventArgs e) { var selected = PCListView.SelectedItems.Cast <ListViewItem>().FirstOrDefault(); if (selected == null) { return; } var server = selected.Tag as MonServer; if (server == null) { return; } var form = new AuditForm(server); form.Show(); }