private void ProcessControlAccessCommand(ControlAccessCommand controlAccessCommand) { var rowIndex = GetRowIndex(controlAccessCommand.ClientId); if (rowIndex < 0) { return; } if (controlAccessCommand.ClientId.Equals(_id) && !(bool)dataGridView["IsInputContollerColumn", rowIndex].Value && controlAccessCommand.IsAllowed) { Invoke((Action)(() => { //Хак, чтобы события правильно отрабатывали (в данном случае нужно только обновление gui без event'а) inputRadioButton.CheckedChanged -= RadioButtonOnCheckedChanged; inputRadioButton.Checked = true; inputRadioButton.CheckedChanged += RadioButtonOnCheckedChanged; })); } if (controlAccessCommand.ClientId.Equals(_id) && (bool)dataGridView["IsInputContollerColumn", rowIndex].Value && !controlAccessCommand.IsAllowed) { Invoke((Action)(() => { //Хак, чтобы события правильно отрабатывали (в данном случае нужно только обновление gui без event'а) inputRadioButton.CheckedChanged -= RadioButtonOnCheckedChanged; inputRadioButton.Checked = false; inputRadioButton.CheckedChanged += RadioButtonOnCheckedChanged; })); } dataGridView["IsInputContollerColumn", rowIndex].Value = controlAccessCommand.IsAllowed; dataGridView.Rows[rowIndex].DefaultCellStyle.BackColor = GetRowBackColor(false); }
public void ChangeControlAccess(string conferenceId, string presenterId, string clientId, bool isAllowed) { var command = new ControlAccessCommand(conferenceId, presenterId, clientId, isAllowed); SendCommand(command); }