コード例 #1
0
 public string OnButtonPressed(ICommandBase onCommand)
 {
     this.onCommand = onCommand;
     onCommand.Execute();
     undoCommand = onCommand;
     return(Convert.ToString(undoCommand));
 }
コード例 #2
0
 private void ExecuteCommand(ICommandBase command)
 {
     try
     {
         command.Execute();
     }
     catch (Exception ex)
     {
         // TODO: LOG EXCEPTION
         Console.WriteLine(ex.Message);
         MessageBox.Show($"Unhandled error while executing command '{command.Name}'.\r\n\r\n{ex.Message}", "WinCommand Palette", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }