private void CheckContextMenu(int count) { buttonDeleteSelected.Enabled = (count > 0) && TemplateBaseDetailDirectiveCollection.HasAccess(Users.CurrentUser.Role, DataEvent.Remove); toolStripMenuItemDelete.Enabled = buttonDeleteSelected.Enabled; toolStripMenuItemView.Enabled = count > 0; headerControl1.ActionControl.ButtonEdit.Enabled = count == 1; if (count == 1) { toolStripMenuItemView.Text = "Go to " + directivesViewer.SelectedItems[0].Title; } else { if (count == 0) { toolStripMenuItemView.Text = "Nothing selected"; } else { toolStripMenuItemView.Text = "View directives"; } } }
private void UpdateInformation() { limitationsControl.ReadOnly = !TemplateBaseDetailDirectiveCollection.HasAccess(Users.CurrentUser.Role, DataEvent.Update); limitationsControl.UpdateInformation(); }