Commit e35c515

unknown <mo@.(none)>
2010-01-24 18:40:00
removed extra presenter interfaces.
1 parent 23546d2
product/Boot/Modules/GettingStartedModule.cs
@@ -26,17 +26,17 @@ namespace MoMoney.Modules
         public void run()
         {
             broker.subscribe(this);
-            command.run<IGettingStartedPresenter>();
+            command.run<GettingStartedPresenter>();
         }
 
         public void notify(NewProjectOpened message)
         {
-            command.run<IGettingStartedPresenter>();
+            command.run<GettingStartedPresenter>();
         }
 
         public void notify(ClosingProjectEvent message)
         {
-            command.run<IGettingStartedPresenter>();
+            command.run<GettingStartedPresenter>();
         }
     }
 }
\ No newline at end of file
product/Boot/Modules/MainMenuModule.cs
@@ -22,7 +22,7 @@ namespace MoMoney.Modules
 
         public void notify(NewProjectOpened message)
         {
-            command.run<IMainMenuPresenter>();
+            command.run<MainMenuPresenter>();
         }
     }
 }
\ No newline at end of file
product/Boot/Modules/NavigationModule.cs
@@ -7,8 +7,8 @@ namespace MoMoney.Modules
 {
     public class NavigationModule : INavigationModule
     {
-        readonly IEventAggregator broker;
-        readonly IRunPresenterCommand command;
+        IEventAggregator broker;
+        IRunPresenterCommand command;
 
         public NavigationModule(IEventAggregator broker, IRunPresenterCommand command)
         {
@@ -23,7 +23,7 @@ namespace MoMoney.Modules
 
         public void notify(NewProjectOpened message)
         {
-            command.run<INavigationPresenter>();
+            command.run<NavigationPresenter>();
         }
     }
 }
\ No newline at end of file
product/Presentation/Core/ApplicationController.cs
@@ -10,7 +10,7 @@ namespace MoMoney.Presentation.Core
 
     public class ApplicationController : IApplicationController, ParameterizedCommand<IPresenter>
     {
-        readonly IShell shell;
+        IShell shell;
         PresenterFactory factory;
 
         public ApplicationController(IShell shell, PresenterFactory factory)
@@ -27,11 +27,9 @@ namespace MoMoney.Presentation.Core
         public void run(IPresenter presenter)
         {
             presenter.present();
-            if (presenter.is_an_implementation_of<IContentPresenter>())
-            {
-                var content_presenter = presenter.downcast_to<IContentPresenter>();
-                shell.add(content_presenter.View);
-            }
+            if (!presenter.is_an_implementation_of<IContentPresenter>()) return;
+
+            shell.add(presenter.downcast_to<IContentPresenter>().View);
         }
     }
 }
\ No newline at end of file
product/Presentation/Core/IContentPresenter.cs
@@ -5,8 +5,5 @@ namespace MoMoney.Presentation.Core
     public interface IContentPresenter : IPresenter
     {
         IDockedContentView View { get; }
-        void activate();
-        void deactivate();
-        bool can_close();
     }
 }
\ No newline at end of file
product/Presentation/Model/Menu/Help/HelpMenu.cs
@@ -46,7 +46,7 @@ namespace MoMoney.Presentation.Model.Menu.Help
                 .a_menu_item()
                 .named("View Log File")
                 .represented_by(ApplicationIcons.ViewLog)
-                .that_executes(() => command.run<ILogFilePresenter>())
+                .that_executes(() => command.run<LogFilePresenter>())
                 .build();
         }
     }
product/Presentation/Model/Navigation/AddNewBillBranch.cs
@@ -14,7 +14,7 @@ namespace MoMoney.Presentation.Model.Navigation
 
         public void visit(ITreeBranch item_to_visit)
         {
-            item_to_visit.add_child("Add Bills", ApplicationIcons.AddIncome, () => command.run<IAddCompanyPresenter>());
+            item_to_visit.add_child("Add Bills", ApplicationIcons.AddIncome, () => command.run<AddCompanyPresenter>());
         }
     }
 }
\ No newline at end of file
product/Presentation/Model/Navigation/ViewAllBillsBranch.cs
@@ -5,9 +5,9 @@ namespace MoMoney.Presentation.Model.Navigation
 {
     public class ViewAllBillsBranch : IBranchVisitor
     {
-        private readonly IRunThe<IViewAllBillsPresenter> command;
+        private readonly IRunThe<ViewAllBillsPresenter> command;
 
-        public ViewAllBillsBranch(IRunThe<IViewAllBillsPresenter> command)
+        public ViewAllBillsBranch(IRunThe<ViewAllBillsPresenter> command)
         {
             this.command = command;
         }
product/Presentation/Presenters/AddBillingTaskPane.cs
@@ -28,7 +28,7 @@ namespace MoMoney.Presentation.Presenters
                 Build.task_pane_item()
                     .named("View All Bills Payments")
                     .represented_by_icon(ApplicationIcons.ViewAllBillPayments)
-                    .when_clicked_execute(() => command.run<IViewAllBillsPresenter>())
+                    .when_clicked_execute(() => command.run<ViewAllBillsPresenter>())
                 )
                 .build();
         }
product/Presentation/Presenters/AddCompanyPresenter.cs
@@ -6,12 +6,7 @@ using MoMoney.Service.Contracts.Application;
 
 namespace MoMoney.Presentation.Presenters
 {
-    public interface IAddCompanyPresenter : IContentPresenter
-    {
-        void submit(RegisterNewCompany dto);
-    }
-
-    public class AddCompanyPresenter : ContentPresenter<IAddCompanyView>, IAddCompanyPresenter
+    public class AddCompanyPresenter : ContentPresenter<IAddCompanyView>
     {
         readonly ICommandPump pump;
 
product/Presentation/Presenters/AddCompanyPresenterSpecs.cs
@@ -7,8 +7,7 @@ using MoMoney.Service.Contracts.Application;
 namespace MoMoney.Presentation.Presenters
 {
     [Concern(typeof (AddCompanyPresenter))]
-    public abstract class behaves_like_the_add_company_presenter :
-        concerns_for<IAddCompanyPresenter, AddCompanyPresenter>
+    public abstract class behaves_like_the_add_company_presenter : concerns_for<AddCompanyPresenter>
     {
         context c = () =>
                         {
product/Presentation/Presenters/AddCompanyTaskPane.cs
@@ -21,7 +21,7 @@ namespace MoMoney.Presentation.Presenters
                 Build.task_pane_item()
                     .named("Add Company")
                     .represented_by_icon(ApplicationIcons.AddCompany)
-                    .when_clicked_execute(() => command.run<IAddCompanyPresenter>()))
+                    .when_clicked_execute(() => command.run<AddCompanyPresenter>()))
                 .build();
         }
     }
product/Presentation/Presenters/AddIncomeTaskPane.cs
@@ -21,13 +21,13 @@ namespace MoMoney.Presentation.Presenters
                 Build.task_pane_item()
                     .named("Add Income")
                     .represented_by_icon(ApplicationIcons.AddNewIncome)
-                    .when_clicked_execute(() => command.run<IAddNewIncomePresenter>())
+                    .when_clicked_execute(() => command.run<AddNewIncomePresenter>())
                 )
                 .with_item(
                 Build.task_pane_item()
                     .named("View All Income")
                     .represented_by_icon(ApplicationIcons.ViewAllIncome)
-                    .when_clicked_execute(() => command.run<IViewIncomeHistoryPresenter>())
+                    .when_clicked_execute(() => command.run<ViewIncomeHistoryPresenter>())
                 )
                 .build();
         }
product/Presentation/Presenters/AddNewIncomePresenter.cs
@@ -6,12 +6,7 @@ using MoMoney.Service.Contracts.Application;
 
 namespace MoMoney.Presentation.Presenters
 {
-    public interface IAddNewIncomePresenter : IContentPresenter
-    {
-        void submit_new(IncomeSubmissionDTO income);
-    }
-
-    public class AddNewIncomePresenter : ContentPresenter<IAddNewIncomeView>, IAddNewIncomePresenter
+    public class AddNewIncomePresenter : ContentPresenter<IAddNewIncomeView>
     {
         readonly ICommandPump pump;
 
product/Presentation/Presenters/AddNewIncomePresenterSpecs.cs
@@ -9,8 +9,7 @@ using MoMoney.Service.Contracts.Application;
 namespace momoney.presentation.presenters
 {
     [Concern(typeof (AddNewIncomePresenter))]
-    public abstract class behaves_like_add_new_income_presenter :
-        concerns_for<IAddNewIncomePresenter, AddNewIncomePresenter>
+    public abstract class behaves_like_add_new_income_presenter : concerns_for< AddNewIncomePresenter>
     {
         context c = () =>
         {
product/Presentation/Presenters/AddReportingTaskPane.cs
@@ -25,13 +25,13 @@ namespace MoMoney.Presentation.Presenters
                 Build.task_pane_item()
                     .named("View All Bills")
                     .represented_by_icon(ApplicationIcons.ViewAllBillPayments)
-                    .when_clicked_execute(() => command.run<IReportPresenter<IViewAllBillsReport, IEnumerable<BillInformationDTO>, IGetAllBillsQuery>>())
+                    .when_clicked_execute(() => command.run<ReportPresenter<IViewAllBillsReport, IEnumerable<BillInformationDTO>, IGetAllBillsQuery>>())
                 )
                 .with_item(
                 Build.task_pane_item()
                     .named("View All Income")
                     .represented_by_icon(ApplicationIcons.ViewAllIncome)
-                    .when_clicked_execute(() => command.run<IReportPresenter<IViewAllIncomeReport, IEnumerable<IncomeInformationDTO>, IGetAllIncomeQuery>>())
+                    .when_clicked_execute(() => command.run<ReportPresenter<IViewAllIncomeReport, IEnumerable<IncomeInformationDTO>, IGetAllIncomeQuery>>())
                 )
                 .build();
         }
product/Presentation/Presenters/GettingStartedPresenter.cs
@@ -3,11 +3,7 @@ using momoney.presentation.views;
 
 namespace momoney.presentation.presenters
 {
-    public interface IGettingStartedPresenter : IContentPresenter
-    {
-    }
-
-    public class GettingStartedPresenter : ContentPresenter<IGettingStartedView>, IGettingStartedPresenter
+    public class GettingStartedPresenter : ContentPresenter<IGettingStartedView>
     {
         public GettingStartedPresenter(IGettingStartedView view) : base(view)
         {
product/Presentation/Presenters/GettingStartedPresenterSpecs.cs
@@ -8,7 +8,7 @@ namespace momoney.presentation.presenters
     public class GettingStartedPresenterSpecs
     {
         public class behaves_like_the_getting_started_presenter :
-            concerns_for<IGettingStartedPresenter, GettingStartedPresenter>
+            concerns_for< GettingStartedPresenter>
         {
             context c = () =>
             {
product/Presentation/Presenters/LogFilePresenter.cs
@@ -4,11 +4,7 @@ using momoney.service.infrastructure.logging;
 
 namespace momoney.presentation.presenters
 {
-    public interface ILogFilePresenter : IContentPresenter
-    {
-    }
-
-    public class LogFilePresenter : ContentPresenter<ILogFileView>, ILogFilePresenter
+    public class LogFilePresenter : ContentPresenter<ILogFileView>
     {
         readonly ILogFileTasks tasks;
 
@@ -21,7 +17,6 @@ namespace momoney.presentation.presenters
         {
             view.display(tasks.get_the_path_to_the_log_file());
             view.run(tasks.get_the_contents_of_the_log_file());
-            //tasks.notify(view);
         }
     }
 }
\ No newline at end of file
product/Presentation/Presenters/LogFileViewPresenterSpecs.cs
@@ -5,7 +5,7 @@ using momoney.service.infrastructure.logging;
 
 namespace momoney.presentation.presenters
 {
-    public class behaves_like_log_file_presenter : concerns_for<ILogFilePresenter, LogFilePresenter>
+    public class behaves_like_log_file_presenter : concerns_for< LogFilePresenter>
     {
         context c = () =>
         {
product/Presentation/Presenters/MainMenuPresenter.cs
@@ -6,9 +6,7 @@ using MoMoney.Presentation.Views;
 
 namespace MoMoney.Presentation.Presenters
 {
-    public interface IMainMenuPresenter : IContentPresenter {}
-
-    public class MainMenuPresenter : ContentPresenter<IMainMenuView>, IMainMenuPresenter
+    public class MainMenuPresenter : ContentPresenter<IMainMenuView>
     {
         IRunPresenterCommand command;
 
product/Presentation/Presenters/NavigationPresenter.cs
@@ -4,11 +4,7 @@ using momoney.presentation.views;
 
 namespace momoney.presentation.presenters
 {
-    public interface INavigationPresenter : IContentPresenter
-    {
-    }
-
-    public class NavigationPresenter : ContentPresenter<INavigationView>, INavigationPresenter
+    public class NavigationPresenter : ContentPresenter<INavigationView>
     {
         readonly INavigationTreeVisitor tree_view_visitor;
 
product/Presentation/Presenters/NavigationPresenterSpecs.cs
@@ -6,7 +6,7 @@ using momoney.presentation.views;
 namespace momoney.presentation.presenters
 {
     [Concern(typeof (NavigationPresenter))]
-    public class when_building_the_navigation_tree : concerns_for<INavigationPresenter, NavigationPresenter>
+    public class when_building_the_navigation_tree : concerns_for< NavigationPresenter>
     {
         it should_visit_the_root_node_of_the_tree = () => view.was_told_to(x => x.accept(tree_view_visitor));
 
product/Presentation/Presenters/ReportPresenter.cs
@@ -6,11 +6,7 @@ using MoMoney.Presentation.Views;
 
 namespace MoMoney.Presentation.Presenters
 {
-    public interface IReportPresenter<Report, T, Query> : IContentPresenter
-        where Report : IBindReportTo<T, Query>
-        where Query : Query<T> {}
-
-    public class ReportPresenter<Report, T, Query> : ContentPresenter<IReportViewer>, IReportPresenter<Report, T, Query>
+    public class ReportPresenter<Report, T, Query> : ContentPresenter<IReportViewer>
         where Report : IBindReportTo<T, Query>
         where Query : Query<T>
     {
product/Presentation/Presenters/ViewAllBillsPresenter.cs
@@ -7,11 +7,7 @@ using MoMoney.Service.Contracts.Application;
 
 namespace momoney.presentation.presenters
 {
-    public interface IViewAllBillsPresenter : IContentPresenter
-    {
-    }
-
-    public class ViewAllBillsPresenter : ContentPresenter<IViewAllBills>, IViewAllBillsPresenter
+    public class ViewAllBillsPresenter : ContentPresenter<IViewAllBills>
     {
         readonly ICommandPump pump;
 
product/Presentation/Presenters/ViewIncomeHistoryPresenter.cs
@@ -6,11 +6,7 @@ using MoMoney.Service.Contracts.Application;
 
 namespace MoMoney.Presentation.Presenters
 {
-    public interface IViewIncomeHistoryPresenter : IContentPresenter
-    {
-    }
-
-    public class ViewIncomeHistoryPresenter : ContentPresenter<IViewIncomeHistory>, IViewIncomeHistoryPresenter
+    public class ViewIncomeHistoryPresenter : ContentPresenter<IViewIncomeHistory>
     {
         readonly ICommandPump pump;
 
product/Presentation/Views/IAddCompanyView.cs
@@ -7,6 +7,6 @@ using momoney.presentation.views;
 namespace MoMoney.Presentation.Views
 {
     public interface IAddCompanyView : IDockedContentView,
-                                       IView<IAddCompanyPresenter>,
+                                       IView<AddCompanyPresenter>,
                                        Callback<IEnumerable<CompanyDTO>> {}
 }
\ No newline at end of file
product/Presentation/Views/IAddNewIncomeView.cs
@@ -7,7 +7,7 @@ using momoney.presentation.views;
 namespace MoMoney.Presentation.Views
 {
     public interface IAddNewIncomeView : IDockedContentView,
-                                         IView<IAddNewIncomePresenter>,
+                                         IView<AddNewIncomePresenter>,
                                          Callback<IEnumerable<CompanyDTO>>,
                                          Callback<IEnumerable<IncomeInformationDTO>> {}
 }
\ No newline at end of file
product/Presentation/Views/IGettingStartedView.cs
@@ -3,7 +3,7 @@ using momoney.presentation.presenters;
 namespace momoney.presentation.views
 {
     public interface IGettingStartedView : IDockedContentView,
-                                           IView<IGettingStartedPresenter>
+                                           IView<GettingStartedPresenter>
     {
     }
 }
\ No newline at end of file
product/Presentation/Views/IViewAllBills.cs
@@ -7,7 +7,7 @@ using momoney.presentation.views;
 namespace MoMoney.Presentation.Views
 {
     public interface IViewAllBills : IDockedContentView,
-                                     IView<IViewAllBillsPresenter>,
+                                     IView<ViewAllBillsPresenter>,
                                      Callback<IEnumerable<BillInformationDTO>>
     {
     }
product/Presentation/Views/IViewIncomeHistory.cs
@@ -7,7 +7,7 @@ using momoney.presentation.views;
 namespace MoMoney.Presentation.Views
 {
     public interface IViewIncomeHistory : IDockedContentView,
-                                          IView<IViewIncomeHistoryPresenter>,
+                                          IView<ViewIncomeHistoryPresenter>,
                                           Callback<IEnumerable<IncomeInformationDTO>>
 
     {
product/Presentation/Winforms/Views/AddCompanyView.cs
@@ -33,7 +33,7 @@ namespace MoMoney.Presentation.Winforms.Views
             ux_cancel_button.Click += (x, y) => Close();
         }
 
-        public void attach_to(IAddCompanyPresenter presenter)
+        public void attach_to(AddCompanyPresenter presenter)
         {
             ux_company_name.bind_to(dto, x => x.company_name);
             submit_button = x => presenter.submit(dto);
product/Presentation/Winforms/Views/AddNewIncomeView.cs
@@ -26,7 +26,7 @@ namespace MoMoney.Presentation.Winforms.Views
             companies_list = ux_companys.create_for<CompanyDTO>();
         }
 
-        public void attach_to(IAddNewIncomePresenter presenter)
+        public void attach_to(AddNewIncomePresenter presenter)
         {
             submit_button = x => presenter.submit_new(create_income());
         }
product/Presentation/Winforms/Views/ViewAllBills.cs
@@ -15,7 +15,7 @@ namespace MoMoney.Presentation.Winforms.Views
             titled("View Bill Payments").icon(ApplicationIcons.ViewAllBillPayments);
         }
 
-        public void attach_to(IViewAllBillsPresenter presenter)
+        public void attach_to(ViewAllBillsPresenter presenter)
         {
         }
 
product/Presentation/Winforms/Views/ViewAllIncome.cs
@@ -15,7 +15,7 @@ namespace MoMoney.Presentation.Winforms.Views
             titled("View All Income").icon(ApplicationIcons.ViewAllIncome);
         }
 
-        public void attach_to(IViewIncomeHistoryPresenter presenter) {}
+        public void attach_to(ViewIncomeHistoryPresenter presenter) {}
 
         public void run(IEnumerable<IncomeInformationDTO> summary)
         {
product/Presentation/Winforms/Views/WelcomeScreen.cs
@@ -24,7 +24,7 @@ namespace MoMoney.Presentation.Winforms.Views
                 .with_tool_tip("Create New File", "Create a new project.");
         }
 
-        public void attach_to(IGettingStartedPresenter presenter)
+        public void attach_to(GettingStartedPresenter presenter)
         {
         }
     }