/// ----------------------------------------------------------------------------- /// <summary> /// Actualise la liste des sessions et connexions /// </summary> /// ----------------------------------------------------------------------------- private void RefreshSessions() { try { BtRefresh.Enabled = BtClose.Enabled = false; UseWaitCursor = true; Application.DoEvents(); var response = _tunnel.Monitor(new SessionContextRequest(_sid)); if (response.Success) { _currentsession = default(Session); SessionsBindingSource.DataSource = response.Sessions; SessionsBindingSource.ResetBindings(false); if (Sessions.SelectedRows.Count > 0) { _currentsession = (Session) Sessions.SelectedRows[0].DataBoundItem; ConnectionsBindingSource.DataSource = _currentsession.Connections; } else ConnectionsBindingSource.DataSource = null; } else HandleResponse(response); } finally { BtRefresh.Enabled = BtClose.Enabled = true; UseWaitCursor = false; } }
/// ----------------------------------------------------------------------------- /// <summary> /// Clic sur un item de la liste des sessions /// </summary> /// <param name="sender">l'appelant</param> /// <param name="e">les parametres</param> /// ----------------------------------------------------------------------------- private void Sessions_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.RowIndex >= Sessions.Rows.Count) return; _currentsession = (Session)Sessions.Rows[e.RowIndex].DataBoundItem; ConnectionsBindingSource.DataSource = _currentsession.Connections; }