Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public AboutCommandMenuItem(ICommand command)
  2. : base(command)
  3. {
  4. }
  5.  
  6. public OptionsCommandMenuItem(ICommand command)
  7. : base(command)
  8. {
  9. }
  10.  
  11. _kernel.Bind<ICommand>().To<AboutCommand>().WhenInjectedExactlyInto<AboutCommandMenuItem>();
  12. _kernel.Bind<ICommand>().To<OptionsCommand>().WhenInjectedExactlyInto<OptionsCommandMenuItem>();
  13.  
  14. _kernel.Bind(t => t.FromThisAssembly()
  15. .SelectAllClasses()
  16. .InNamespaceOf<ICommand>()
  17. .EndingWith("Command")
  18. .Where(type => type.GetInterfaces().Contains(typeof(ICommand)))
  19. .BindAllInterfaces()
  20. .Configure(binding => binding
  21. .When(request => request.Service == typeof(ICommand)
  22. && request.Target.Member.DeclaringType.Name.StartsWith(?)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement