Guest User

Untitled

a guest
Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public static class EventAggregatorExtensions
  2. {
  3. public static void Subscribe(this IEventAggregator eventAggregator, params IHandle[] handlers)
  4. {
  5. Subscribe(eventAggregator, (IEnumerable<IHandle>)handlers);
  6. }
  7.  
  8. public static void Subscribe(this IEventAggregator eventAggregator, IEnumerable<IHandle> handlers)
  9. {
  10. foreach(var handler in handlers)
  11. {
  12. if(handler != null)
  13. eventAggregator.Subscribe(handler);
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment