Commit 5d7a873
Changed files (22)
trunk
src
MyMoney
Presentation
Model
messages
Presenters
Views
billing
core
dialogs
Navigation
reporting
updates
trunk/src/MyMoney/Presentation/Model/messages/saved_changes_event.cs
@@ -3,5 +3,6 @@ using MyMoney.Infrastructure.eventing;
namespace MyMoney.Presentation.Model.messages
{
public class saved_changes_event : IEvent
- {}
+ {
+ }
}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Presenters/Shell/notification_icon_presenter.cs
@@ -6,7 +6,9 @@ using MyMoney.Presentation.Views.Shell;
namespace MyMoney.Presentation.Presenters.Shell
{
- public interface INotificationIconPresenter : IPresentationModule, IEventSubscriber<closing_the_application>
+ public interface INotificationIconPresenter : IPresentationModule,
+ IEventSubscriber<closing_the_application>,
+ IEventSubscriber<new_project_opened>
{
}
@@ -24,7 +26,8 @@ namespace MyMoney.Presentation.Presenters.Shell
public void run()
{
- broker.subscribe_to(this);
+ broker.subscribe_to<closing_the_application>(this);
+ broker.subscribe_to<new_project_opened>(this);
view.display(ApplicationIcons.Application, "mokhan.ca");
}
@@ -32,5 +35,10 @@ namespace MyMoney.Presentation.Presenters.Shell
{
view.Dispose();
}
+
+ public void notify(new_project_opened message)
+ {
+ view.opened_new_project();
+ }
}
}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Presenters/Shell/notification_icon_presenter_specs.cs
@@ -9,11 +9,12 @@ using MyMoney.Testing.spechelpers.core;
namespace MyMoney.Presentation.Presenters.Shell
{
[Concern(typeof (notification_icon_presenter))]
- public class when_initializing_the_notification_icon :
- concerns_for<INotificationIconPresenter, notification_icon_presenter>
+ public abstract class behaves_like_notification_icon_presenter : concerns_for<INotificationIconPresenter, notification_icon_presenter>
{
- it should_ask_the_view_to_display_the_correct_icon_and_text =
- () => view.was_told_to(v => v.display(ApplicationIcons.Application, "mokhan.ca"));
+ public override INotificationIconPresenter create_sut()
+ {
+ return new notification_icon_presenter(view, broker);
+ }
context c = () =>
{
@@ -21,14 +22,14 @@ namespace MyMoney.Presentation.Presenters.Shell
broker = the_dependency<IEventAggregator>();
};
- because b = () => sut.run();
+ protected static INotificationIconView view;
+ protected static IEventAggregator broker;
+ }
- public override INotificationIconPresenter create_sut()
- {
- return new notification_icon_presenter(view, broker);
- }
+ public class when_initializing_the_notification_icon : behaves_like_notification_icon_presenter
+ {
+ it should_ask_the_view_to_display_the_correct_icon_and_text = () => view.was_told_to(v => v.display(ApplicationIcons.Application, "mokhan.ca"));
- static INotificationIconView view;
- static IEventAggregator broker;
+ because b = () => sut.run();
}
}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Views/billing/add_bill_payment.cs
@@ -2,17 +2,17 @@
using MyMoney.Domain.accounting.billing;
using MyMoney.Presentation.Presenters.billing;
using MyMoney.Presentation.Presenters.billing.dto;
+using MyMoney.Presentation.Views.core;
using MyMoney.Utility.Extensions;
-using WeifenLuo.WinFormsUI.Docking;
namespace MyMoney.Presentation.Views.billing
{
- public partial class add_bill_payment : DockContent, IAddBillPaymentView
+ public partial class add_bill_payment : ApplicationDockedWindow, IAddBillPaymentView
{
public add_bill_payment()
{
InitializeComponent();
- TabText = "Add Bill Payment";
+ titled("Add Bill Payment");
}
public void attach_to(IAddBillPaymentPresenter presenter)
@@ -30,7 +30,7 @@ namespace MyMoney.Presentation.Views.billing
ux_bil_payments_grid.DataSource = bills.databind();
}
- private add_new_bill_dto create_dto()
+ add_new_bill_dto create_dto()
{
return new add_new_bill_dto
{
trunk/src/MyMoney/Presentation/Views/billing/view_all_bills.cs
@@ -1,16 +1,16 @@
using System.Collections.Generic;
using System.Linq;
using MyMoney.Presentation.Presenters.billing.dto;
-using WeifenLuo.WinFormsUI.Docking;
+using MyMoney.Presentation.Views.core;
namespace MyMoney.Presentation.Views.billing
{
- public partial class view_all_bills : DockContent, IViewAllBills
+ public partial class view_all_bills : ApplicationDockedWindow, IViewAllBills
{
public view_all_bills()
{
InitializeComponent();
- TabText = "View Bills";
+ titled("View Bills");
}
public void display(IEnumerable<bill_information_dto> bills)
trunk/src/MyMoney/Presentation/Views/core/ApplicationDockedWindow.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Linq;
+using System.Windows.Forms;
+using MyMoney.Presentation.Resources;
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace MyMoney.Presentation.Views.core
+{
+ public interface IApplicationDockedWindow : IDockedContentView
+ {
+ IApplicationDockedWindow create_tool_tip_for(string title, string caption, Control control);
+ IApplicationDockedWindow titled(string title);
+ IApplicationDockedWindow icon(ApplicationIcon icon);
+ }
+
+ public partial class ApplicationDockedWindow : DockContent, IApplicationDockedWindow
+ {
+ public ApplicationDockedWindow()
+ {
+ InitializeComponent();
+ Id = Guid.NewGuid();
+ TabText = "Undefined";
+ Icon = ApplicationIcons.Application;
+ }
+
+ Guid Id { get; set; }
+
+ public IApplicationDockedWindow create_tool_tip_for(string title, string caption, Control control)
+ {
+ new ToolTip {IsBalloon = true, ToolTipTitle = title}.SetToolTip(control, caption);
+ return this;
+ }
+
+ public IApplicationDockedWindow titled(string title)
+ {
+ TabText = title;
+ return this;
+ }
+
+ public IApplicationDockedWindow icon(ApplicationIcon icon)
+ {
+ Icon = icon;
+ return this;
+ }
+
+ public void AddTo(DockPanel panel)
+ {
+ var panel_to_remove = panel.Documents.SingleOrDefault(x => x.DockHandler.TabText.Equals(TabText));
+ if (panel_to_remove != null)
+ {
+ panel_to_remove.DockHandler.Close();
+ panel_to_remove.DockHandler.Dispose();
+ }
+ Show(panel);
+ }
+ }
+}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Views/core/ApplicationDockedWindow.Designer.cs
@@ -0,0 +1,38 @@
+namespace MyMoney.Presentation.Views.core
+{
+ partial class ApplicationDockedWindow
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Text = "ApplicationDockedWindow";
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Views/core/ApplicationForm.cs → trunk/src/MyMoney/Presentation/Views/core/ApplicationWindow.cs
@@ -3,18 +3,19 @@ using MyMoney.Presentation.Resources;
namespace MyMoney.Presentation.Views.core
{
- public partial class ApplicationForm : Form
+ public partial class ApplicationWindow : Form
{
- public ApplicationForm(string title)
+ public ApplicationWindow(string title)
{
InitializeComponent();
Icon = ApplicationIcons.Application;
base.Text = "MoMoney - " + title;
}
- protected void create_tool_tip_for(string title, string caption, Control control)
+ protected ApplicationWindow create_tool_tip_for(string title, string caption, Control control)
{
new ToolTip {IsBalloon = true, ToolTipTitle = title}.SetToolTip(control, caption);
+ return this;
}
}
}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Views/core/ApplicationForm.Designer.cs → trunk/src/MyMoney/Presentation/Views/core/ApplicationWindow.Designer.cs
@@ -1,6 +1,6 @@
-namespace MyMoney.Presentation.Views.core
+namespace MyMoney.Presentation.Views.core
{
- partial class ApplicationForm
+ partial class ApplicationWindow
{
/// <summary>
/// Required designer variable.
trunk/src/MyMoney/Presentation/Views/core/ApplicationForm.resx → trunk/src/MyMoney/Presentation/Views/core/ApplicationWindow.resx
File renamed without changes
trunk/src/MyMoney/Presentation/Views/core/IDockedContentView.cs
@@ -7,6 +7,6 @@ namespace MyMoney.Presentation.Views.core
public interface IDockedContentView : IDockContent, ISynchronizeInvoke, IDisposable
{
string TabText { get; }
- void Show(DockPanel ux_dock_panel);
+ void AddTo(DockPanel panel);
}
}
\ No newline at end of file
trunk/src/MyMoney/Presentation/Views/dialogs/save_changes_view.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Windows.Forms;
using MyMoney.Presentation.Model.Menu.File.Commands;
using MyMoney.Presentation.Resources;
@@ -6,7 +6,7 @@ using MyMoney.Presentation.Views.core;
namespace MyMoney.Presentation.Views.dialogs
{
- public partial class save_changes_view : ApplicationForm, ISaveChangesView
+ public partial class save_changes_view : ApplicationWindow, ISaveChangesView
{
private bool can_be_closed;
trunk/src/MyMoney/Presentation/Views/income/add_new_income_view.cs
@@ -4,17 +4,17 @@ using MyMoney.Domain.accounting.billing;
using MyMoney.Presentation.Model.interaction;
using MyMoney.Presentation.Presenters.income;
using MyMoney.Presentation.Presenters.income.dto;
+using MyMoney.Presentation.Views.core;
using MyMoney.Utility.Extensions;
-using WeifenLuo.WinFormsUI.Docking;
namespace MyMoney.Presentation.Views.income
{
- public partial class add_new_income_view : DockContent, IAddNewIncomeView
+ public partial class add_new_income_view : ApplicationDockedWindow, IAddNewIncomeView
{
public add_new_income_view()
{
InitializeComponent();
- TabText = "Add Income";
+ titled("Add Income");
}
public void attach_to(IAddNewIncomePresenter presenter)
@@ -37,7 +37,7 @@ namespace MyMoney.Presentation.Views.income
throw new NotImplementedException();
}
- private income_submission_dto create_income()
+ income_submission_dto create_income()
{
return new income_submission_dto
{
trunk/src/MyMoney/Presentation/Views/income/view_all_income.cs
@@ -1,17 +1,16 @@
using System.Collections.Generic;
-using System.Linq;
using MyMoney.Presentation.Presenters.income.dto;
+using MyMoney.Presentation.Views.core;
using MyMoney.Utility.Extensions;
-using WeifenLuo.WinFormsUI.Docking;
namespace MyMoney.Presentation.Views.income
{
- public partial class view_all_income : DockContent, IViewIncomeHistory
+ public partial class view_all_income : ApplicationDockedWindow, IViewIncomeHistory
{
public view_all_income()
{
InitializeComponent();
- TabText = "View All Income";
+ titled("View All Income");
}
public void display(IEnumerable<income_information_dto> summary)
trunk/src/MyMoney/Presentation/Views/reporting/report_viewer.cs
@@ -1,11 +1,11 @@
using DataDynamics.ActiveReports;
using MyMoney.Presentation.Model.reporting;
+using MyMoney.Presentation.Views.core;
using MyMoney.Utility.Extensions;
-using WeifenLuo.WinFormsUI.Docking;
namespace MyMoney.Presentation.Views.reporting
{
- public partial class report_viewer : DockContent, IReportView
+ public partial class report_viewer : ApplicationDockedWindow, IReportView
{
public report_viewer()
{
trunk/src/MyMoney/Presentation/Views/Shell/notification_icon_view.cs
@@ -12,16 +12,17 @@ namespace MyMoney.Presentation.Views.Shell
public interface INotificationIconView : IDisposable
{
void display(ApplicationIcon icon_to_display, string text_to_display);
+ void opened_new_project();
}
[Singleton]
public class notification_icon_view : INotificationIconView
{
- private NotifyIcon ux_notification_icon;
- private readonly IFileMenu file_menu;
- private readonly IWindowMenu window_menu;
- private readonly IHelpMenu help_menu;
- private bool hooked_up;
+ NotifyIcon ux_notification_icon;
+ readonly IFileMenu file_menu;
+ readonly IWindowMenu window_menu;
+ readonly IHelpMenu help_menu;
+ bool hooked_up;
public notification_icon_view(IFileMenu file_menu, IWindowMenu window_menu, IHelpMenu help_menu)
{
@@ -58,7 +59,12 @@ namespace MyMoney.Presentation.Views.Shell
hooked_up = true;
}
- private MenuItem map_from(ISubMenu item)
+ public void opened_new_project()
+ {
+ ux_notification_icon.ShowBalloonTip(100, "If you need any help check out mokhan.ca", "", ToolTipIcon.Info);
+ }
+
+ MenuItem map_from(ISubMenu item)
{
var toolStripMenuItem = new MenuItem(item.name);
foreach (var menuItem in item.all_menu_items())
trunk/src/MyMoney/Presentation/Views/Shell/window_shell.cs
@@ -35,15 +35,16 @@ namespace MyMoney.Presentation.Views.Shell
public void add(IDockedContentView view)
{
- var panel_to_remove = ux_dock_panel
- .Documents
- .SingleOrDefault(x => x.DockHandler.TabText.Equals(view.TabText));
- if (panel_to_remove != null) {
- panel_to_remove.DockHandler.Close();
- panel_to_remove.DockHandler.Dispose();
- }
+ //var panel_to_remove = ux_dock_panel
+ // .Documents
+ // .SingleOrDefault(x => x.DockHandler.TabText.Equals(view.TabText));
+ //if (panel_to_remove != null) {
+ // panel_to_remove.DockHandler.Close();
+ // panel_to_remove.DockHandler.Dispose();
+ //}
+ //view.Show(ux_dock_panel);
- view.Show(ux_dock_panel);
+ view.AddTo(ux_dock_panel);
}
public void add_to_main_menu(ToolStripMenuItem item)
trunk/src/MyMoney/Presentation/Views/updates/check_for_updates.cs
@@ -7,7 +7,7 @@ using MyMoney.Presentation.Views.core;
namespace MyMoney.Presentation.Views.updates
{
- public partial class check_for_updates : ApplicationForm, ICheckForUpdatesView
+ public partial class check_for_updates : ApplicationWindow, ICheckForUpdatesView
{
public check_for_updates() : base("Check For Updates")
{
trunk/src/MyMoney/Presentation/Views/add_new_company_view.cs
@@ -6,19 +6,19 @@ using MyMoney.Presentation.Databindings;
using MyMoney.Presentation.Model.interaction;
using MyMoney.Presentation.Presenters;
using MyMoney.Presentation.Presenters.billing.dto;
+using MyMoney.Presentation.Views.core;
using MyMoney.Utility.Extensions;
-using WeifenLuo.WinFormsUI.Docking;
namespace MyMoney.Presentation.Views
{
- public partial class add_new_company_view : DockContent, IAddCompanyView
+ public partial class add_new_company_view : ApplicationDockedWindow, IAddCompanyView
{
- private readonly register_new_company dto;
+ readonly register_new_company dto;
public add_new_company_view()
{
InitializeComponent();
- TabText = "Add A Company";
+ titled("Add A Company");
dto = new register_new_company();
}
@@ -40,7 +40,5 @@ namespace MyMoney.Presentation.Views
messages.each(x => builder.Append(x));
MessageBox.Show(builder.ToString());
}
-
-
}
}
\ No newline at end of file
trunk/src/MyMoney/MyMoney.csproj
@@ -360,11 +360,17 @@
<DependentUpon>add_bill_payment.cs</DependentUpon>
</Compile>
<Compile Include="Presentation\Views\billing\IAddBillPaymentView.cs" />
- <Compile Include="Presentation\Views\core\ApplicationForm.cs">
+ <Compile Include="Presentation\Views\core\ApplicationDockedWindow.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Presentation\Views\core\ApplicationForm.Designer.cs">
- <DependentUpon>ApplicationForm.cs</DependentUpon>
+ <Compile Include="Presentation\Views\core\ApplicationDockedWindow.Designer.cs">
+ <DependentUpon>ApplicationDockedWindow.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Presentation\Views\core\ApplicationWindow.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Presentation\Views\core\ApplicationWindow.Designer.cs">
+ <DependentUpon>ApplicationWindow.cs</DependentUpon>
</Compile>
<Compile Include="Presentation\Views\dialogs\ISaveChangesView.cs" />
<Compile Include="Presentation\Views\dialogs\save_changes_view.cs">
@@ -579,8 +585,8 @@
<DependentUpon>view_all_bills.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Presentation\Views\core\ApplicationForm.resx">
- <DependentUpon>ApplicationForm.cs</DependentUpon>
+ <EmbeddedResource Include="Presentation\Views\core\ApplicationWindow.resx">
+ <DependentUpon>ApplicationWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Presentation\Views\dialogs\save_changes_view.resx">
<DependentUpon>save_changes_view.cs</DependentUpon>
@@ -660,7 +666,6 @@
<Folder Include="Presentation\Presenters\messages\" />
<Folder Include="Tasks\domain\" />
<Folder Include="Tasks\Stubs\" />
- <Folder Include="Testing\Extensions\" />
<Folder Include="Testing\spechelpers\concerns\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />