private static void OnBaseBeforeQueryStatus(object sender, EventArgs e) { var command = sender as BaseCommand; var commandName = command.GetType().Name; OutputWindow.Debug($"Command {commandName} OnBeforeQueryStatus."); try { command.OnBeforeQueryStatus(); } catch (Exception ex) { OutputWindow.Error($"Failed to enable command {commandName}.", ex); } }