Commit 693a46c

unknown <mo@.(none)>
2009-09-05 21:06:42
updating main menu icons
1 parent c1eb716
product/Boot/boot/container/registration/wire_up_the_reports_in_to_the.cs
@@ -1,6 +1,6 @@
 using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Utility.Core;
-using MoMoney.Presentation.Views.billing;
+using MoMoney.Presentation.Views;
 using MoMoney.Presentation.Views.reporting;
 using MoMoney.Presentation.Winforms.Views;
 
product/Boot/Modules/MainMenuModule.cs
@@ -1,7 +1,6 @@
 using Gorilla.Commons.Infrastructure.Eventing;
 using MoMoney.Presentation.Model.messages;
 using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Presenters.Navigation;
 
 namespace MoMoney.Modules
 {
product/Presentation/Model/Navigation/ViewAllBillsReportBranch.cs
@@ -1,14 +1,14 @@
+using MoMoney.Presentation.Presenters;
 using MoMoney.Presentation.Presenters.Commands;
-using MoMoney.Presentation.Presenters.reporting;
 using MoMoney.Presentation.Winforms.Resources;
 
 namespace MoMoney.Presentation.Model.Navigation
 {
     public class ViewAllBillsReportBranch : IBranchVisitor
     {
-        private readonly IRunThe<IViewAllBillsReportPresenter> command;
+        private readonly IRunThe<IReportPresenter> command;
 
-        public ViewAllBillsReportBranch(IRunThe<IViewAllBillsReportPresenter> command)
+        public ViewAllBillsReportBranch(IRunThe<IReportPresenter> command)
         {
             this.command = command;
         }
product/Presentation/Presenters/AddBillingTaskPane.cs
@@ -1,8 +1,9 @@
 using MoMoney.Presentation.Presenters.billing;
+using MoMoney.Presentation.Presenters.Navigation;
 using MoMoney.Presentation.Winforms.Resources;
 using XPExplorerBar;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public class AddBillingTaskPane : IActionTaskPaneFactory
     {
@@ -21,13 +22,13 @@ namespace MoMoney.Presentation.Presenters.Navigation
                 .with_item(
                 Build.task_pane_item()
                     .named("Add Bill Payments")
-                    .represented_by_image(ApplicationImages.ReadingABill)
+                    .represented_by_icon(ApplicationIcons.AddBillPayment)
                     .when_clicked_execute(() => command.run<IAddBillPaymentPresenter>())
                 )
                 .with_item(
                 Build.task_pane_item()
-                    .named("View All Bills")
-                    .represented_by_image(ApplicationImages.ReadingABill)
+                    .named("View All Bills Payments")
+                    .represented_by_icon(ApplicationIcons.ViewAllBillPayments)
                     .when_clicked_execute(() => command.run<IViewAllBillsPresenter>())
                 )
                 .build();
product/Presentation/Presenters/AddCompanyTaskPane.cs
@@ -1,7 +1,8 @@
+using MoMoney.Presentation.Presenters.Navigation;
 using MoMoney.Presentation.Winforms.Resources;
 using XPExplorerBar;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public class AddCompanyTaskPane : IActionTaskPaneFactory
     {
@@ -19,7 +20,7 @@ namespace MoMoney.Presentation.Presenters.Navigation
                 .with_item(
                 Build.task_pane_item()
                     .named("Add Company")
-                    .represented_by_image(ApplicationImages.CompanyDetails)
+                    .represented_by_icon(ApplicationIcons.AddCompany)
                     .when_clicked_execute(() => command.run<IAddCompanyPresenter>()))
                 .build();
         }
product/Presentation/Presenters/AddIncomeTaskPane.cs
@@ -1,8 +1,9 @@
 using MoMoney.Presentation.Presenters.income;
+using MoMoney.Presentation.Presenters.Navigation;
 using MoMoney.Presentation.Winforms.Resources;
 using XPExplorerBar;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public class AddIncomeTaskPane : IActionTaskPaneFactory
     {
@@ -19,14 +20,14 @@ namespace MoMoney.Presentation.Presenters.Navigation
                 .named("Income")
                 .with_item(
                 Build.task_pane_item()
-                    .named("Add New Income")
-                    .represented_by_image(ApplicationImages.PayingABill)
+                    .named("Add Income")
+                    .represented_by_icon(ApplicationIcons.AddNewIncome)
                     .when_clicked_execute(() => command.run<IAddNewIncomePresenter>())
                 )
                 .with_item(
                 Build.task_pane_item()
                     .named("View All Income")
-                    .represented_by_image(ApplicationImages.PayingABill)
+                    .represented_by_icon(ApplicationIcons.ViewAllIncome)
                     .when_clicked_execute(() => command.run<IViewIncomeHistoryPresenter>())
                 )
                 .build();
product/Presentation/Presenters/AddReportingTaskPane.cs
@@ -1,8 +1,8 @@
-using MoMoney.Presentation.Presenters.reporting;
+using MoMoney.Presentation.Presenters.Navigation;
 using MoMoney.Presentation.Winforms.Resources;
 using XPExplorerBar;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public class AddReportingTaskPane : IActionTaskPaneFactory
     {
@@ -21,7 +21,7 @@ namespace MoMoney.Presentation.Presenters.Navigation
                 Build.task_pane_item()
                     .named("View All Bills")
                     .represented_by_image(ApplicationImages.ReadingABill)
-                    .when_clicked_execute(() => command.run<IViewAllBillsReportPresenter>())
+                    .when_clicked_execute(() => command.run<IReportPresenter>())
                 )
                 .build();
         }
product/Presentation/Presenters/ExpandoItemBuilder.cs
@@ -5,19 +5,20 @@ using Gorilla.Commons.Utility.Core;
 using MoMoney.Presentation.Winforms.Resources;
 using XPExplorerBar;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public interface IExpandoItemBuilder : IBuilder<TaskItem>
     {
         IExpandoItemBuilder named(string name);
         IExpandoItemBuilder represented_by_image(ApplicationImage image);
+        IExpandoItemBuilder represented_by_icon(HybridIcon image);
         IExpandoItemBuilder when_clicked_execute(Action action);
     }
 
     public class ExpandoItemBuilder : IExpandoItemBuilder
     {
         string the_name = "";
-        ApplicationImage the_image;
+        Image the_image;
         Action the_action = () => { };
 
         public IExpandoItemBuilder named(string name)
@@ -31,6 +32,12 @@ namespace MoMoney.Presentation.Presenters.Navigation
             the_image = image;
             return this;
         }
+        
+        public IExpandoItemBuilder represented_by_icon(HybridIcon icon)
+        {
+            the_image = icon;
+            return this;
+        }
 
         public IExpandoItemBuilder when_clicked_execute(Action action)
         {
product/Presentation/Presenters/MainMenuPresenter.cs
@@ -1,9 +1,10 @@
-using Gorilla.Commons.Utility.Core;
+using System.Collections.Generic;
 using Gorilla.Commons.Utility.Extensions;
 using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.Navigation;
+using MoMoney.Presentation.Presenters.Navigation;
+using MoMoney.Presentation.Views;
 
-namespace MoMoney.Presentation.Presenters.Navigation
+namespace MoMoney.Presentation.Presenters
 {
     public interface IMainMenuPresenter : IContentPresenter
     {
@@ -11,16 +12,24 @@ namespace MoMoney.Presentation.Presenters.Navigation
 
     public class MainMenuPresenter : ContentPresenter<IMainMenuView>, IMainMenuPresenter
     {
-        readonly IRegistry<IActionTaskPaneFactory> registry;
+        IRunPresenterCommand command;
 
-        public MainMenuPresenter(IMainMenuView view, IRegistry<IActionTaskPaneFactory> registry) : base(view)
+        public MainMenuPresenter(IMainMenuView view, IRunPresenterCommand command) : base(view)
         {
-            this.registry = registry;
+            this.command = command;
         }
 
         public override void run()
         {
-            registry.all().each(x => view.add(x));
+            all_factories().each(x => view.add(x));
+        }
+
+        IEnumerable<IActionTaskPaneFactory> all_factories()
+        {
+            yield return new AddCompanyTaskPane(command);
+            yield return new AddIncomeTaskPane(command);
+            yield return new AddBillingTaskPane(command);
+            yield return new AddReportingTaskPane(command);
         }
     }
 }
\ No newline at end of file
product/Presentation/Presenters/ReportPresenter.cs
@@ -1,15 +1,15 @@
 using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.billing;
+using MoMoney.Presentation.Views;
 using MoMoney.Presentation.Views.reporting;
 using MoMoney.Service.Contracts.Application;
 
-namespace MoMoney.Presentation.Presenters.reporting
+namespace MoMoney.Presentation.Presenters
 {
-    public interface IViewAllBillsReportPresenter : IContentPresenter
+    public interface IReportPresenter : IContentPresenter
     {
     }
 
-    public class ReportPresenter : ContentPresenter<IReportViewer>, IViewAllBillsReportPresenter
+    public class ReportPresenter : ContentPresenter<IReportViewer>, IReportPresenter
     {
         readonly IViewAllBillsReport report;
         readonly IGetAllBillsQuery query;
product/Presentation/Views/IMainMenuView.cs
@@ -1,7 +1,7 @@
 using MoMoney.Presentation.Presenters.Navigation;
 using MoMoney.Presentation.Views.Core;
 
-namespace MoMoney.Presentation.Views.Navigation
+namespace MoMoney.Presentation.Views
 {
     public interface IMainMenuView : IDockedContentView
     {
product/Presentation/Views/IViewAllBillsReport.cs
@@ -2,7 +2,7 @@ using System.Collections.Generic;
 using MoMoney.DTO;
 using MoMoney.Presentation.Model.reporting;
 
-namespace MoMoney.Presentation.Views.billing
+namespace MoMoney.Presentation.Views
 {
     public interface IViewAllBillsReport : IReport
     {
product/Presentation/Winforms/Resources/ApplicationIcons.cs
@@ -23,6 +23,12 @@ namespace MoMoney.Presentation.Winforms.Resources
         static public readonly HybridIcon CloseWindow = new HybridIcon("minimize_box_blue.ico", x => add(x));
         static public readonly HybridIcon Empty = new HybridIcon("", x => add(x));
 
+        static public readonly HybridIcon AddCompany = new HybridIcon("plus__orange.ico", x => add(x));
+        static public readonly HybridIcon AddNewIncome = new HybridIcon("plus__orange.ico", x => add(x));
+        static public readonly HybridIcon ViewAllIncome = new HybridIcon("search.ico", x => add(x));
+        static public readonly HybridIcon AddBillPayment = new HybridIcon("plus__orange.ico", x => add(x));
+        static public readonly HybridIcon ViewAllBillPayments = new HybridIcon("search.ico", x => add(x));
+
         static public IEnumerable<ApplicationIcon> all()
         {
             return all_icons.all();
product/Presentation/Winforms/Resources/ApplicationImages.cs
@@ -27,5 +27,6 @@ namespace MoMoney.Presentation.Winforms.Resources
 
         public static readonly ApplicationImage GenerateReportDisabled =
             new ApplicationImage("generate_report_disabled.png");
+
     }
 }
\ No newline at end of file
product/Presentation/Winforms/Views/MainMenuView.cs
@@ -1,5 +1,5 @@
 using MoMoney.Presentation.Presenters.Navigation;
-using MoMoney.Presentation.Views.Navigation;
+using MoMoney.Presentation.Views;
 using MoMoney.Presentation.Winforms.Helpers;
 using MoMoney.Presentation.Winforms.Resources;
 using WeifenLuo.WinFormsUI.Docking;
product/Presentation/Winforms/Views/ViewAllBillsReport.cs
@@ -4,7 +4,7 @@ using DataDynamics.ActiveReports;
 using Gorilla.Commons.Utility.Extensions;
 using MoMoney.DTO;
 using MoMoney.Presentation.Model.reporting;
-using MoMoney.Presentation.Views.billing;
+using MoMoney.Presentation.Views;
 
 namespace MoMoney.Presentation.Winforms.Views
 {