Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. interface ICommand
  2. {
  3.     void Execute();
  4. }
  5.  
  6. interface IAnotherCommand: ICommand
  7. {
  8.     void DernutAnus();
  9. }
  10.  
  11. interface IOneMoreCommand : ICommand
  12. {
  13.     void Abc();
  14. }
  15.  
  16. /////////////////////////////////
  17.  
  18. foreach(ICommand command from ListOfCommands)
  19. {
  20.     //дополнительные действия
  21.     if(bla-bla-bla)
  22.     {
  23.         (IAnotherCommand)command.DernutAnus();
  24.     }
  25.  
  26.     command.Run();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement