Commit a40750b
Changed files (14)
trunk
product
MyMoney
Presentation
Presenters
Views
Shell
trunk/product/MyMoney/Presentation/Presenters/Commands/run_the.cs
@@ -4,11 +4,12 @@ using MoMoney.Utility.Core;
namespace MoMoney.Presentation.Presenters.Commands
{
public interface IRunThe<Presenter> : ICommand where Presenter : IPresenter
- {}
+ {
+ }
public class run_the<Presenter> : IRunThe<Presenter> where Presenter : IPresenter
{
- private readonly IApplicationController applicationController;
+ readonly IApplicationController applicationController;
public run_the(IApplicationController applicationController)
{
trunk/product/MyMoney/Presentation/Presenters/Commands/run_presenter_command.cs → trunk/product/MyMoney/Presentation/Presenters/Commands/RunPresenterCommand.cs
@@ -7,11 +7,11 @@ namespace MoMoney.Presentation.Presenters.Commands
void run<Presenter>() where Presenter : IPresenter;
}
- public class run_presenter_command : IRunPresenterCommand
+ public class RunPresenterCommand : IRunPresenterCommand
{
private readonly IApplicationController application_controller;
- public run_presenter_command(IApplicationController applicationController)
+ public RunPresenterCommand(IApplicationController applicationController)
{
application_controller = applicationController;
}
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedModule.cs
@@ -0,0 +1,34 @@
+using MoMoney.Infrastructure.eventing;
+using MoMoney.Presentation.Core;
+using MoMoney.Presentation.Model.messages;
+using MoMoney.Presentation.Presenters.Commands;
+
+namespace MoMoney.Presentation.Presenters.Shell
+{
+ public interface IGettingStartedModule : IPresentationModule, IEventSubscriber<new_project_opened>
+ {
+ }
+
+ public class GettingStartedModule : IGettingStartedModule
+ {
+ readonly IEventAggregator broker;
+ IRunPresenterCommand command;
+
+ public GettingStartedModule(IEventAggregator broker, IRunPresenterCommand command)
+ {
+ this.broker = broker;
+ this.command = command;
+ }
+
+ public void run()
+ {
+ broker.subscribe_to(this);
+ command.run<IGettingStartedPresenter>();
+ }
+
+ public void notify(new_project_opened message)
+ {
+ command.run<IGettingStartedPresenter>();
+ }
+ }
+}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedModuleSpecs.cs
@@ -0,0 +1,32 @@
+using jpboodhoo.bdd.contexts;
+using MoMoney.Infrastructure.eventing;
+using MoMoney.Presentation.Presenters.Commands;
+using MoMoney.Testing.spechelpers.contexts;
+using MoMoney.Testing.spechelpers.core;
+
+namespace MoMoney.Presentation.Presenters.Shell
+{
+ public class GettingStartedModuleSpecs
+ {
+ public class behaves_like_the_getting_started_module :
+ concerns_for<IGettingStartedModule, GettingStartedModule>
+ {
+ context c = () =>
+ {
+ broker = the_dependency<IEventAggregator>();
+ command = the_dependency<IRunPresenterCommand>();
+ };
+
+ protected static IEventAggregator broker;
+ protected static IRunPresenterCommand command;
+ }
+
+ public class when_initializing_the_getting_started_module : behaves_like_the_getting_started_module
+ {
+ it should_start_listening_for_when_a_new_project_is_started =
+ () => broker.was_told_to(x => x.subscribe_to(sut));
+
+ because b = () => sut.run();
+ }
+ }
+}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedPresenter.cs
@@ -1,36 +1,30 @@
-using JetBrains.Annotations;
-using MoMoney.Infrastructure.eventing;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.messages;
+using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.Shell;
namespace MoMoney.Presentation.Presenters.Shell
{
- public interface IGettingStartedPresenter : IPresentationModule, IEventSubscriber<new_project_opened>
+ public interface IGettingStartedPresenter : IContentPresenter
{
}
- [UsedImplicitly]
public class GettingStartedPresenter : IGettingStartedPresenter
{
readonly IGettingStartedView view;
- readonly IEventAggregator broker;
- public GettingStartedPresenter(IGettingStartedView view, IEventAggregator broker)
+ public GettingStartedPresenter(IGettingStartedView view)
{
this.view = view;
- this.broker = broker;
}
public void run()
{
- broker.subscribe_to(this);
view.display();
}
- public void notify(new_project_opened message)
+ public IDockedContentView View
{
- //view.display();
+ get { return view; }
}
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedPresenterSpecs.cs
@@ -1,6 +1,5 @@
using jpboodhoo.bdd.contexts;
using MoMoney.Infrastructure.eventing;
-using MoMoney.Presentation.Model.messages;
using MoMoney.Presentation.Views.Shell;
using MoMoney.Testing.spechelpers.contexts;
using MoMoney.Testing.spechelpers.core;
@@ -12,11 +11,6 @@ namespace MoMoney.Presentation.Presenters.Shell
public class behaves_like_the_getting_started_presenter :
concerns_for<IGettingStartedPresenter, GettingStartedPresenter>
{
- //public override IGettingStartedPresenter create_sut()
- //{
- // return new GettingStartedPresenter(view, broker);
- //}
-
context c = () =>
{
view = the_dependency<IGettingStartedView>();
@@ -27,19 +21,11 @@ namespace MoMoney.Presentation.Presenters.Shell
protected static IGettingStartedView view;
}
- public class when_initializing_the_getting_started_module : behaves_like_the_getting_started_presenter
- {
- it should_start_listening_for_when_a_new_project_is_started =
- () => broker.was_told_to(x => x.subscribe_to(sut));
-
- because b = () => sut.run();
- }
-
public class when_a_new_project_is_opened : behaves_like_the_getting_started_presenter
{
it should_display_the_getting_started_screen = () => view.was_told_to(x => x.display());
- because b = () => sut.notify(new new_project_opened(""));
+ because b = () => sut.run();
}
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/core/ApplicationDockedWindow.cs
@@ -23,6 +23,7 @@ namespace MoMoney.Presentation.Views.core
InitializeComponent();
Icon = ApplicationIcons.Application;
dock_state = DockState.Document;
+ HideOnClose = true;
}
public IApplicationDockedWindow create_tool_tip_for(string title, string caption, Control control)
trunk/product/MyMoney/Presentation/Views/Shell/WelcomeScreen.cs
@@ -6,11 +6,8 @@ namespace MoMoney.Presentation.Views.Shell
{
public partial class WelcomeScreen : ApplicationDockedWindow, IGettingStartedView
{
- readonly IShell shell;
-
- public WelcomeScreen(IShell shell)
+ public WelcomeScreen()
{
- this.shell = shell;
InitializeComponent();
titled("Getting Started");
//base.BackgroundImage = ApplicationImages.Welcome;
@@ -28,19 +25,6 @@ namespace MoMoney.Presentation.Views.Shell
.when_hovered_over_will_show(ApplicationImages.CreateNewFileSelected)
.will_execute<INewCommand>(() => true)
.with_tool_tip("Create New File", "Create a new project.");
-
- //ux_company_details_button
- // .will_be_shown_as(ApplicationImages.CompanyDetails)
- // .when_hovered_over_will_show(ApplicationImages.CompanyDetailsSelected)
- // .will_execute<ICompanyTreeNode>(is_there_a_protocol_selected)
- // .with_tool_tip("Company Details", "Capture the company details.");
-
- //ux_generate_report_button
- // .will_be_shown_as(ApplicationImages.GenerateReport)
- // .when_hovered_over_will_show(ApplicationImages.GenerateReportSelected)
- // .will_execute<IGenerateReportCommand>(is_there_a_protocol_selected)
- // .with_tool_tip("Generate Report", "Generate a printable report.");
- shell.add(this);
}
}
}
\ No newline at end of file
trunk/product/MyMoney/MyMoney.csproj
@@ -329,7 +329,7 @@
<Compile Include="Presentation\Presenters\billing\dto\register_new_company.cs" />
<Compile Include="Presentation\Presenters\billing\ViewAllBillsPresenter.cs" />
<Compile Include="Presentation\Presenters\Commands\RestartCommand.cs" />
- <Compile Include="Presentation\Presenters\Commands\run_presenter_command.cs" />
+ <Compile Include="Presentation\Presenters\Commands\RunPresenterCommand.cs" />
<Compile Include="Presentation\Presenters\Commands\run_the.cs" />
<Compile Include="Presentation\Presenters\Commands\run_the_specs.cs" />
<Compile Include="Presentation\Presenters\excel\Cell.cs" />
@@ -360,7 +360,11 @@
<Compile Include="Presentation\Presenters\Navigation\ExpandoBuilder.cs" />
<Compile Include="Presentation\Presenters\Navigation\ExpandoItemBuilder.cs" />
<Compile Include="Presentation\Presenters\Navigation\IActionTaskPaneFactory.cs" />
+ <Compile Include="Presentation\Presenters\Navigation\MainMenuModule.cs" />
+ <Compile Include="Presentation\Presenters\Navigation\NavigationModule.cs" />
<Compile Include="Presentation\Presenters\Shell\ApplicationShellPresenter.cs" />
+ <Compile Include="Presentation\Presenters\Shell\GettingStartedModule.cs" />
+ <Compile Include="Presentation\Presenters\Shell\GettingStartedModuleSpecs.cs" />
<Compile Include="Presentation\Presenters\Shell\GettingStartedPresenter.cs" />
<Compile Include="Presentation\Presenters\Shell\GettingStartedPresenterSpecs.cs" />
<Compile Include="Presentation\Presenters\Shell\ToolBarPresenter.cs" />