private void pConnectionsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { string requestID = senderGrid.Columns[e.ColumnIndex].Tag.ToString(); string partnerUsername = itemList[e.RowIndex].RequesterUsername; if (!screenShareManager.CheckPartnerAvailability(partnerUsername)) { MessageBox.Show("Your partner is not available at the moment! You can try again or skip this section!"); } else { int reqID = screenShareManager.AcceptScreenShareRequest(int.Parse(requestID), userID); this.Hide(); DesktopApplicationForm daf = new DesktopApplicationForm(reqID, userID, "Request"); daf.FormClosed += (s, args) => this.Close(); daf.Show(); } } }
public bool CheckPartnerAvailability(string username) { return(screenShareComplexManager.CheckPartnerAvailability(username)); }