public void UnRegisterCommand(OleMenuCommand command) { if (_registeredCommands.SingleOrDefault( cmd => cmd.CommandID.Guid.Equals(command.CommandID.Guid) && cmd.CommandID.ID.Equals(command.CommandID.ID)) != null) { _registeredCommands.Remove(command); } }