@@ -620,10 +620,6 @@ private void RegisterCommandMenuItems(IWindsorContainer container)
620
620
621
621
private void RegisterCommands ( IWindsorContainer container )
622
622
{
623
- //note: convention: the registration name for commands is the type name, not the full type name.
624
- //Otherwise, namespaces would get in the way when binding to the menu items.
625
- RegisterCommandsWithPresenters ( container ) ;
626
-
627
623
// assumption: All Commands are in the same assembly as CommandBase
628
624
container . Register ( Classes . FromAssemblyContaining ( typeof ( CommandBase ) )
629
625
. IncludeNonPublicTypes ( )
@@ -636,46 +632,6 @@ private void RegisterCommands(IWindsorContainer container)
636
632
. LifestyleTransient ( ) ) ;
637
633
}
638
634
639
- private void RegisterCommandsWithPresenters ( IWindsorContainer container )
640
- {
641
- // FIXME these registrations shouldn't be IoC's business. the presenters should require those themselves!
642
- // Possible solution: Property Injection
643
- container . Register ( Component . For < CommandBase > ( )
644
- . ImplementedBy < RunAllTestsCommand > ( )
645
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , TestExplorerDockablePresenter > ( ) )
646
- . LifestyleTransient ( )
647
- . Named ( typeof ( RunAllTestsCommand ) . Name ) ) ;
648
- container . Register ( Component . For < CommandBase > ( )
649
- . ImplementedBy < TestExplorerCommand > ( )
650
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , TestExplorerDockablePresenter > ( ) )
651
- . LifestyleTransient ( )
652
- . Named ( typeof ( TestExplorerCommand ) . Name ) ) ;
653
-
654
- container . Register ( Component . For < CommandBase > ( )
655
- . ImplementedBy < InspectionResultsCommand > ( )
656
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , InspectionResultsDockablePresenter > ( ) )
657
- . LifestyleTransient ( )
658
- . Named ( typeof ( InspectionResultsCommand ) . Name ) ) ;
659
-
660
- container . Register ( Component . For < CommandBase > ( )
661
- . ImplementedBy < CodeExplorerCommand > ( )
662
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , CodeExplorerDockablePresenter > ( ) )
663
- . LifestyleTransient ( )
664
- . Named ( typeof ( CodeExplorerCommand ) . Name ) ) ;
665
-
666
- container . Register ( Component . For < CommandBase > ( )
667
- . ImplementedBy < CodeMetricsCommand > ( )
668
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , CodeMetricsDockablePresenter > ( ) )
669
- . LifestyleSingleton ( )
670
- . Named ( typeof ( CodeMetricsCommand ) . Name ) ) ;
671
-
672
- container . Register ( Component . For < CommandBase > ( )
673
- . ImplementedBy < ToDoExplorerCommand > ( )
674
- . DependsOn ( Dependency . OnComponent < IDockablePresenter , ToDoExplorerDockablePresenter > ( ) )
675
- . LifestyleTransient ( )
676
- . Named ( typeof ( ToDoExplorerCommand ) . Name ) ) ;
677
- }
678
-
679
635
private void RegisterSmartIndenter ( IWindsorContainer container )
680
636
{
681
637
container . Register ( Component . For < IIndenter , Indenter > ( )
@@ -710,17 +666,11 @@ private void RegisterDockableUserControls(IWindsorContainer container)
710
666
711
667
private void RegisterDockablePresenters ( IWindsorContainer container )
712
668
{
713
- container . Register ( Component . For < IDockablePresenter > ( )
714
- . ImplementedBy < TestExplorerDockablePresenter > ( )
715
- . LifestyleSingleton ( ) ) ;
716
- container . Register ( Component . For < IDockablePresenter > ( )
717
- . ImplementedBy < InspectionResultsDockablePresenter > ( )
718
- . LifestyleSingleton ( ) ) ;
719
- container . Register ( Component . For < IDockablePresenter > ( )
720
- . ImplementedBy < CodeExplorerDockablePresenter > ( )
721
- . LifestyleSingleton ( ) ) ;
722
- container . Register ( Component . For < IDockablePresenter > ( )
723
- . ImplementedBy < ToDoExplorerDockablePresenter > ( )
669
+ container . Register ( Classes . FromAssemblyContaining < IDockablePresenter > ( )
670
+ . IncludeNonPublicTypes ( )
671
+ . BasedOn < IDockablePresenter > ( )
672
+ . WithServiceSelf ( )
673
+ . WithServices ( new [ ] { typeof ( IDockablePresenter ) } )
724
674
. LifestyleSingleton ( ) ) ;
725
675
}
726
676
0 commit comments