public static void ShowConnectedDevices(DataTable devices) { var frm = new ConnectedDevices { Data = devices }; frm.ShowDialog(); }
private void ItmConnectedDevicesList_Click(object sender, EventArgs e) { try { //test authentication var success = ArcLogin.IsAuthenticated(); if (success) { var init = new CgiStations(); var dt = init.GrabTable(); if (dt != null) { if (dt.Rows.Count > 0) { ConnectedDevices.ShowConnectedDevices(dt); } else { UiMessages.Warning( @"Topology info from modem returned 0 devices connected; operation failed.", @"Data Error"); } } else { UiMessages.Warning("Topology info from modem returned nothing useful. " + "Please note that this is rate-limited, and the modem will reject too many requests within an undefined time-frame.", @"Data Error"); } } else { UiMessages.Warning(@"Authentication required; please authenticate first."); } } catch (Exception ex) { UiMessages.Error(ex.ToString()); } }