Commit 2051081
Changed files (26)
trunk
product
MyMoney
boot
container
registration
Domain
Presentation
Core
Presenters
Navigation
reporting
Views
Navigation
Tasks
infrastructure
updating
trunk/product/MyMoney/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -36,6 +36,7 @@ namespace MoMoney.boot.container.registration
registry.transient<IFileMenu, FileMenu>();
registry.transient<IWindowMenu, WindowMenu>();
registry.transient<IHelpMenu, HelpMenu>();
+
item
.all_types()
trunk/product/MyMoney/Domain/Core/Percent.cs
@@ -26,7 +26,8 @@ namespace MoMoney.Domain.Core
public bool is_less_than(Percent other_percent)
{
- throw new NotImplementedException();
+ //return other_percent.percentage.CompareTo(percentage) > 0;
+ return percentage.CompareTo(other_percent.percentage) < 0;
}
public static implicit operator Percent(double percentage)
trunk/product/MyMoney/Domain/Core/PercentSpecs.cs
@@ -13,4 +13,19 @@ namespace MoMoney.Domain.Core
{
it should_return_the_correct_percentage = () => new Percent(30, 90).should_be_equal_to<Percent>(33.3);
}
+
+ public class when_checking_if_50_percent_is_less_than_51_percent : concerns
+ {
+ it should_return_true = () => new Percent(50).is_less_than(new Percent(51)).should_be_true();
+ }
+
+ public class when_checking_if_51_percent_is_less_than_50_percent : concerns
+ {
+ it should_return_false = () => new Percent(51).is_less_than(new Percent(50)).should_be_false();
+ }
+
+ public class when_checking_if_50_percent_is_less_than_50_percent : concerns
+ {
+ it should_return_false = () => new Percent(50).is_less_than(new Percent(50)).should_be_false();
+ }
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Core/ContentPresenter.cs
@@ -4,12 +4,18 @@ namespace MoMoney.Presentation.Core
{
public abstract class ContentPresenter<T> : IContentPresenter where T : IDockedContentView
{
+ protected readonly T view;
+
protected ContentPresenter(T view)
{
- View = view;
+ this.view = view;
}
public abstract void run();
- public IDockedContentView View { get; set; }
+
+ IDockedContentView IContentPresenter.View
+ {
+ get { return view; }
+ }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/billing/AddBillPaymentPresenter.cs
@@ -2,7 +2,6 @@ using MoMoney.Domain.accounting.billing;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.billing.dto;
using MoMoney.Presentation.Views.billing;
-using MoMoney.Presentation.Views.core;
using MoMoney.Tasks.application;
using MoMoney.Utility.Extensions;
@@ -13,18 +12,16 @@ namespace MoMoney.Presentation.Presenters.billing
void submit_bill_payment(add_new_bill_dto dto);
}
- public class AddBillPaymentPresenter : IAddBillPaymentPresenter
+ public class AddBillPaymentPresenter : ContentPresenter<IAddBillPaymentView>, IAddBillPaymentPresenter
{
- private readonly IAddBillPaymentView view;
- private readonly IBillingTasks tasks;
+ readonly IBillingTasks tasks;
- public AddBillPaymentPresenter(IAddBillPaymentView view, IBillingTasks tasks)
+ public AddBillPaymentPresenter(IAddBillPaymentView view, IBillingTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.attach_to(this);
view.display(tasks.all_companys());
@@ -37,7 +34,7 @@ namespace MoMoney.Presentation.Presenters.billing
view.display(tasks.all_bills().map_all_using(x => map_from(x)));
}
- private bill_information_dto map_from(IBill bill)
+ bill_information_dto map_from(IBill bill)
{
return new bill_information_dto
{
@@ -46,10 +43,5 @@ namespace MoMoney.Presentation.Presenters.billing
due_date = bill.due_date.to_date_time(),
};
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/billing/ViewAllBillsPresenter.cs
@@ -1,7 +1,6 @@
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.billing.dto;
using MoMoney.Presentation.Views.billing;
-using MoMoney.Presentation.Views.core;
using MoMoney.Tasks.application;
using MoMoney.Utility.Extensions;
@@ -11,18 +10,16 @@ namespace MoMoney.Presentation.Presenters.billing
{
}
- public class ViewAllBillsPresenter : IViewAllBillsPresenter
+ public class ViewAllBillsPresenter : ContentPresenter<IViewAllBills>, IViewAllBillsPresenter
{
- readonly IViewAllBills view;
readonly IBillingTasks tasks;
- public ViewAllBillsPresenter(IViewAllBills view, IBillingTasks tasks)
+ public ViewAllBillsPresenter(IViewAllBills view, IBillingTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.display(
tasks
@@ -35,10 +32,5 @@ namespace MoMoney.Presentation.Presenters.billing
due_date = x.due_date.to_date_time(),
}));
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/income/AddNewIncomePresenter.cs
@@ -3,7 +3,6 @@ using MoMoney.Domain.accounting.financial_growth;
using MoMoney.Domain.Core;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.income.dto;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.income;
using MoMoney.Tasks.application;
using MoMoney.Utility.Extensions;
@@ -15,18 +14,16 @@ namespace MoMoney.Presentation.Presenters.income
void submit_new(IncomeSubmissionDto income);
}
- public class AddNewIncomePresenter : IAddNewIncomePresenter
+ public class AddNewIncomePresenter : ContentPresenter<IAddNewIncomeView>, IAddNewIncomePresenter
{
- private readonly IAddNewIncomeView view;
- private readonly IIncomeTasks tasks;
+ readonly IIncomeTasks tasks;
- public AddNewIncomePresenter(IAddNewIncomeView view, IIncomeTasks tasks)
+ public AddNewIncomePresenter(IAddNewIncomeView view, IIncomeTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.attach_to(this);
view.display(tasks.all_companys());
@@ -43,18 +40,18 @@ namespace MoMoney.Presentation.Presenters.income
view.display(tasks.retrive_all_income().map_all_using(x => map_from(x)));
}
- private bool similar_income_has_been_submitted(IncomeSubmissionDto income)
+ bool similar_income_has_been_submitted(IncomeSubmissionDto income)
{
if (tasks.retrive_all_income().Count() == 0) return false;
return tasks
- .retrive_all_income()
- .where(x => x.amount_tendered.Equals(income.amount.as_money()))
- .where(x => x.company.id.Equals(income.company_id))
- .where(x => x.date_of_issue.Equals(income.recieved_date.as_a_date()))
- .Count() > 0 ;
+ .retrive_all_income()
+ .where(x => x.amount_tendered.Equals(income.amount.as_money()))
+ .where(x => x.company.id.Equals(income.company_id))
+ .where(x => x.date_of_issue.Equals(income.recieved_date.as_a_date()))
+ .Count() > 0;
}
- private static income_information_dto map_from(IIncome x)
+ static income_information_dto map_from(IIncome x)
{
return new income_information_dto
{
@@ -63,10 +60,5 @@ namespace MoMoney.Presentation.Presenters.income
recieved_date = x.date_of_issue.to_string(),
};
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/income/ViewIncomeHistoryPresenter.cs
@@ -1,8 +1,6 @@
-using System.Linq;
using MoMoney.Domain.accounting.financial_growth;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.income.dto;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.income;
using MoMoney.Tasks.application;
using MoMoney.Utility.Extensions;
@@ -13,23 +11,21 @@ namespace MoMoney.Presentation.Presenters.income
{
}
- public class ViewIncomeHistoryPresenter : IViewIncomeHistoryPresenter
+ public class ViewIncomeHistoryPresenter : ContentPresenter<IViewIncomeHistory>, IViewIncomeHistoryPresenter
{
- private readonly IViewIncomeHistory view;
- private readonly IIncomeTasks tasks;
+ readonly IIncomeTasks tasks;
- public ViewIncomeHistoryPresenter(IViewIncomeHistory view, IIncomeTasks tasks)
+ public ViewIncomeHistoryPresenter(IViewIncomeHistory view, IIncomeTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.display(tasks.retrive_all_income().map_all_using(x => map_from(x)));
}
- private income_information_dto map_from(IIncome x)
+ income_information_dto map_from(IIncome x)
{
return new income_information_dto
{
@@ -38,10 +34,5 @@ namespace MoMoney.Presentation.Presenters.income
recieved_date = x.date_of_issue.ToString(),
};
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Menu/Help/AboutTheApplicationPresenter.cs
@@ -1,5 +1,4 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.Menu.Help;
namespace MoMoney.Presentation.Presenters.Menu.Help
@@ -8,23 +7,14 @@ namespace MoMoney.Presentation.Presenters.Menu.Help
{
}
- public class AboutTheApplicationPresenter : IAboutApplicationPresenter
+ public class AboutTheApplicationPresenter : ContentPresenter<IAboutApplicationView>, IAboutApplicationPresenter
{
- readonly IAboutApplicationView view;
-
- public AboutTheApplicationPresenter(IAboutApplicationView view)
- {
- this.view = view;
- }
-
- public void run()
+ public AboutTheApplicationPresenter(IAboutApplicationView view) : base(view)
{
- view.display();
}
- IDockedContentView IContentPresenter.View
+ public override void run()
{
- get { return view; }
}
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Menu/Help/AboutTheApplicationPresenterSpecs.cs
@@ -1,25 +0,0 @@
-using developwithpassion.bdd.contexts;
-using MoMoney.Presentation.Views.Menu.Help;
-using MoMoney.Testing.MetaData;
-using MoMoney.Testing.spechelpers.contexts;
-using MoMoney.Testing.spechelpers.core;
-
-namespace MoMoney.Presentation.Presenters.Menu.Help
-{
- [Concern(typeof (AboutTheApplicationPresenter))]
- public abstract class behaves_like_the_application_information_presenter :
- concerns_for<IAboutApplicationPresenter, AboutTheApplicationPresenter>
- {
- context c = () => { view = the_dependency<IAboutApplicationView>(); };
-
- protected static IAboutApplicationView view;
- }
-
- public class when_initializing_the_application_information_presenter :
- behaves_like_the_application_information_presenter
- {
- because b = () => sut.run();
-
- it should_display_the_view = () => view.was_told_to(x => x.display());
- }
-}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/reporting/ReportPresenter.cs
@@ -2,7 +2,6 @@ using MoMoney.Domain.accounting.billing;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.billing.dto;
using MoMoney.Presentation.Views.billing;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.reporting;
using MoMoney.Tasks.application;
using MoMoney.Utility.Extensions;
@@ -13,20 +12,18 @@ namespace MoMoney.Presentation.Presenters.reporting
{
}
- public class ReportPresenter : IViewAllBillsReportPresenter
+ public class ReportPresenter : ContentPresenter<IReportViewer>, IViewAllBillsReportPresenter
{
- readonly IReportViewer view;
readonly IViewAllBillsReport report;
readonly IBillingTasks tasks;
- public ReportPresenter(IReportViewer view, IViewAllBillsReport report, IBillingTasks tasks)
+ public ReportPresenter(IReportViewer view, IViewAllBillsReport report, IBillingTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
this.report = report;
}
- public void run()
+ public override void run()
{
report.bind_to(tasks.all_bills().map_all_using(x => map_from(x)));
view.display(report);
@@ -41,10 +38,5 @@ namespace MoMoney.Presentation.Presenters.reporting
the_amount_owed = x.the_amount_owed.to_string()
};
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedPresenter.cs
@@ -1,5 +1,4 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.Shell;
namespace MoMoney.Presentation.Presenters.Shell
@@ -8,23 +7,15 @@ namespace MoMoney.Presentation.Presenters.Shell
{
}
- public class GettingStartedPresenter : IGettingStartedPresenter
+ public class GettingStartedPresenter : ContentPresenter<IGettingStartedView>, IGettingStartedPresenter
{
- readonly IGettingStartedView view;
-
- public GettingStartedPresenter(IGettingStartedView view)
+ public GettingStartedPresenter(IGettingStartedView view) : base(view)
{
- this.view = view;
}
- public void run()
+ public override void run()
{
view.display();
}
-
- public IDockedContentView View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/LogFilePresenter.cs
@@ -1,5 +1,4 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views.core;
using MoMoney.Presentation.Views.Shell;
using MoMoney.Tasks.infrastructure;
@@ -9,27 +8,20 @@ namespace MoMoney.Presentation.Presenters.Shell
{
}
- public class LogFilePresenter : ILogFilePresenter
+ public class LogFilePresenter : ContentPresenter<ILogFileView>, ILogFilePresenter
{
- readonly ILogFileView view;
readonly ILogFileTasks tasks;
- public LogFilePresenter(ILogFileView view, ILogFileTasks tasks)
+ public LogFilePresenter(ILogFileView view, ILogFileTasks tasks) : base(view)
{
- this.view = view;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.display(tasks.get_the_path_to_the_log_file());
view.run(tasks.get_the_contents_of_the_log_file());
//tasks.notify(view);
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/updates/CheckForUpdatesPresenter.cs
@@ -1,7 +1,9 @@
using MoMoney.Domain.Core;
using MoMoney.Presentation.Core;
+using MoMoney.Presentation.Model.updates;
using MoMoney.Presentation.Presenters.Commands;
using MoMoney.Presentation.Views.updates;
+using MoMoney.Tasks.infrastructure.core;
using MoMoney.Tasks.infrastructure.updating;
using MoMoney.Utility.Core;
@@ -19,27 +21,27 @@ namespace MoMoney.Presentation.Presenters.updates
{
readonly ICheckForUpdatesView view;
readonly IRestartCommand command;
- readonly IDisplayNextAvailableVersion display_version_command;
readonly IDownloadTheLatestVersion download_the_latest;
readonly ICancelUpdate cancel_requested_update;
+ readonly ICommandPump pump;
public CheckForUpdatesPresenter(ICheckForUpdatesView view,
+ ICommandPump pump,
IRestartCommand command,
- IDisplayNextAvailableVersion display_version_command,
IDownloadTheLatestVersion download_the_latest,
ICancelUpdate cancel_requested_update)
{
+ this.pump = pump;
this.view = view;
this.cancel_requested_update = cancel_requested_update;
this.download_the_latest = download_the_latest;
- this.display_version_command = display_version_command;
this.command = command;
}
public void run()
{
+ pump.run<ApplicationVersion, IWhatIsTheAvailableVersion>(view);
view.attach_to(this);
- display_version_command.run(view);
view.display();
}
trunk/product/MyMoney/Presentation/Presenters/updates/CheckForUpdatesPresenterSpecs.cs
@@ -1,6 +1,8 @@
using developwithpassion.bdd.contexts;
+using MoMoney.Presentation.Model.updates;
using MoMoney.Presentation.Presenters.Commands;
using MoMoney.Presentation.Views.updates;
+using MoMoney.Tasks.infrastructure.core;
using MoMoney.Tasks.infrastructure.updating;
using MoMoney.Testing.MetaData;
using MoMoney.Testing.spechelpers.contexts;
@@ -17,15 +19,15 @@ namespace MoMoney.Presentation.Presenters.updates
view = the_dependency<ICheckForUpdatesView>();
command = the_dependency<IRestartCommand>();
download_the_latest = the_dependency<IDownloadTheLatestVersion>();
- next_version = the_dependency<IDisplayNextAvailableVersion>();
+ pump = the_dependency<ICommandPump>();
cancel_update = the_dependency<ICancelUpdate>();
};
protected static ICheckForUpdatesView view;
protected static IRestartCommand command;
protected static IDownloadTheLatestVersion download_the_latest;
- protected static IDisplayNextAvailableVersion next_version;
protected static ICancelUpdate cancel_update;
+ protected static ICommandPump pump;
}
public class when_attempting_to_check_for_updates : behaves_like_check_for_updates_presenter
@@ -35,7 +37,7 @@ namespace MoMoney.Presentation.Presenters.updates
it should_tell_the_view_to_display_the_information_on_the_current_version_of_the_application =
() => view.was_told_to(x => x.display());
- it should_go_and_find_out_what_the_latest_version_is = () => next_version.was_told_to(x => x.run(view));
+ it should_go_and_find_out_what_the_latest_version_is = () => pump.was_told_to(x => x.run<ApplicationVersion, IWhatIsTheAvailableVersion>(view));
because b = () => sut.run();
}
trunk/product/MyMoney/Presentation/Presenters/AddCompanyPresenter.cs
@@ -4,7 +4,6 @@ using MoMoney.Domain.accounting.billing;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters.billing.dto;
using MoMoney.Presentation.Views;
-using MoMoney.Presentation.Views.core;
using MoMoney.Tasks.application;
using MoMoney.Tasks.infrastructure.core;
using MoMoney.Utility.Extensions;
@@ -16,20 +15,18 @@ namespace MoMoney.Presentation.Presenters
void submit(RegisterNewCompany dto);
}
- public class AddCompanyPresenter : IAddCompanyPresenter
+ public class AddCompanyPresenter : ContentPresenter<IAddCompanyView>, IAddCompanyPresenter
{
- readonly IAddCompanyView view;
readonly IBillingTasks tasks;
readonly ICommandPump pump;
- public AddCompanyPresenter(IAddCompanyView view, IBillingTasks tasks, ICommandPump pump)
+ public AddCompanyPresenter(IAddCompanyView view, IBillingTasks tasks, ICommandPump pump) : base(view)
{
- this.view = view;
this.pump = pump;
this.tasks = tasks;
}
- public void run()
+ public override void run()
{
view.attach_to(this);
pump.run<IEnumerable<ICompany>, IGetAllCompanysQuery>(view);
@@ -54,10 +51,5 @@ namespace MoMoney.Presentation.Presenters
{
return "A Company named {0}, has already been submitted!".formatted_using(dto.company_name);
}
-
- IDockedContentView IContentPresenter.View
- {
- get { return view; }
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/core/ApplicationDockedWindow.cs
@@ -97,13 +97,13 @@ namespace MoMoney.Presentation.Views.core
return x.DockHandler.TabText.Equals(TabText);
}
- protected void on_ui_thread(Action action)
- {
- //if (InvokeRequired) BeginInvoke(action);
- //else action();
+ //protected void on_ui_thread(Action action)
+ //{
+ // //if (InvokeRequired) BeginInvoke(action);
+ // //else action();
- action();
- }
+ // action();
+ //}
Control adapt(ToolTip item)
{
trunk/product/MyMoney/Presentation/Views/Menu/Help/AboutTheApplicationView.cs
@@ -15,31 +15,22 @@ namespace MoMoney.Presentation.Views.Menu.Help
protected override void OnLoad(EventArgs e)
{
- var assembly = GetType() .Assembly;
- on_ui_thread(() =>
- {
- labelProductName.Text = assembly.get_attribute<AssemblyProductAttribute>().Product;
- labelVersion.Text = string.Format("Version {0} {0}", assembly_version);
- uxCopyright.Text = assembly.get_attribute<AssemblyCopyrightAttribute>().Copyright;
- uxCompanyName.Text = assembly.get_attribute<AssemblyCompanyAttribute>().Company;
- uxDescription.Text = assembly.get_attribute<AssemblyDescriptionAttribute>().Description;
- ux_logo.Image = ApplicationImages.Splash;
- });
+ var assembly = GetType().Assembly;
+ labelProductName.Text = assembly.get_attribute<AssemblyProductAttribute>().Product;
+ labelVersion.Text = string.Format("Version {0} {0}", assembly_version);
+ uxCopyright.Text = assembly.get_attribute<AssemblyCopyrightAttribute>().Copyright;
+ uxCompanyName.Text = assembly.get_attribute<AssemblyCompanyAttribute>().Company;
+ uxDescription.Text = assembly.get_attribute<AssemblyDescriptionAttribute>().Description;
+ ux_logo.Image = ApplicationImages.Splash;
}
public void display()
{
- //on_ui_thread(() => ShowDialog());
}
string assembly_version
{
get { return GetType().Assembly.GetName().Version.ToString(); }
}
-
- Attribute get_attribute<Attribute>() where Attribute : System.Attribute
- {
- return GetType().Assembly.get_attribute<Attribute>();
- }
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Menu/Help/IAboutApplicationView.cs
@@ -4,6 +4,5 @@ namespace MoMoney.Presentation.Views.Menu.Help
{
public interface IAboutApplicationView : IDockedContentView
{
- void display();
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/updates/CheckForUpdatesView.cs
@@ -12,7 +12,7 @@ namespace MoMoney.Presentation.Views.updates
public partial class CheckForUpdatesView : ApplicationWindow, ICheckForUpdatesView
{
ICheckForUpdatesPresenter the_presenter;
- IShell shell;
+ readonly IShell shell;
public CheckForUpdatesView(IShell shell)
{
@@ -29,44 +29,36 @@ namespace MoMoney.Presentation.Views.updates
public void attach_to(ICheckForUpdatesPresenter presenter)
{
- on_ui_thread(() =>
- {
- ux_update_button.Click += (sender, e) =>
- {
- ux_update_button.Enabled = false;
- ux_dont_update_button.Enabled = false;
- ux_cancel_button.Enabled = true;
- presenter.begin_update();
- };
- ux_dont_update_button.Click += (sender, e) => presenter.do_not_update();
- ux_cancel_button.Click += (sender, e) => presenter.cancel_update();
- the_presenter = presenter;
- });
+ ux_update_button.Click += (o, e) =>
+ {
+ ux_update_button.Enabled = false;
+ ux_dont_update_button.Enabled = false;
+ ux_cancel_button.Enabled = true;
+ presenter.begin_update();
+ };
+ ux_dont_update_button.Click += (o, e) => presenter.do_not_update();
+ ux_cancel_button.Click += (o, e) => presenter.cancel_update();
+ the_presenter = presenter;
}
public void display()
{
- on_ui_thread(() =>
- {
- ux_update_button.Enabled = false;
- ux_dont_update_button.Enabled = false;
- ux_cancel_button.Enabled = false;
- Show(shell);
- });
+ ux_update_button.Enabled = false;
+ ux_dont_update_button.Enabled = false;
+ ux_cancel_button.Enabled = false;
+ Show(shell);
}
public void downloaded(Percent percentage_complete)
{
- on_ui_thread(() =>
- {
- while (percentage_complete.is_less_than(progress_bar.Value))
- {
- if (percentage_complete.represents(progress_bar.Value))
- break;
-
- progress_bar.PerformStep();
- }
- });
+ shell.region<ToolStripProgressBar>(x =>
+ {
+ while (percentage_complete.is_less_than(x.Value))
+ {
+ if (percentage_complete.represents(x.Value)) break;
+ x.PerformStep();
+ }
+ });
}
public void update_complete()
@@ -81,28 +73,23 @@ namespace MoMoney.Presentation.Views.updates
public void run(ApplicationVersion information)
{
- on_ui_thread(
- () =>
- {
- if (information.updates_available)
- {
- ux_update_button.Enabled = true;
- ux_dont_update_button.Enabled = true;
- ux_cancel_button.Enabled = true;
- ux_update_button.Enabled = information.updates_available;
- ux_current_version.Text = "Current: " + information.current;
- ux_new_version.Text = "New: " + information.available_version;
- }
- else
- {
- ux_update_button.Enabled = false;
- ux_dont_update_button.Enabled = true;
- ux_cancel_button.Enabled = false;
- ux_current_version.Text = "Current: " +
- Assembly.GetExecutingAssembly().GetName().Version;
- ux_new_version.Text = "New: " + Assembly.GetExecutingAssembly().GetName().Version;
- }
- });
+ if (information.updates_available)
+ {
+ ux_update_button.Enabled = true;
+ ux_dont_update_button.Enabled = true;
+ ux_cancel_button.Enabled = true;
+ ux_update_button.Enabled = information.updates_available;
+ ux_current_version.Text = "Current: " + information.current;
+ ux_new_version.Text = "New: " + information.available_version;
+ }
+ else
+ {
+ ux_update_button.Enabled = false;
+ ux_dont_update_button.Enabled = true;
+ ux_cancel_button.Enabled = false;
+ ux_current_version.Text = "Current: " + Assembly.GetExecutingAssembly().GetName().Version;
+ ux_new_version.Text = "New: " + Assembly.GetExecutingAssembly().GetName().Version;
+ }
}
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/updates/CheckForUpdatesView.Designer.cs
@@ -37,7 +37,6 @@ namespace MoMoney.Presentation.Views.updates
this.ux_update_button = new System.Windows.Forms.Button();
this.ux_new_version = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
- this.progress_bar = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.ux_image)).BeginInit();
this.SuspendLayout();
//
@@ -135,20 +134,11 @@ namespace MoMoney.Presentation.Views.updates
this.label5.TabIndex = 17;
this.label5.Text = "to";
//
- // progress_bar
- //
- this.progress_bar.Location = new System.Drawing.Point(174, 87);
- this.progress_bar.Name = "progress_bar";
- this.progress_bar.Size = new System.Drawing.Size(195, 23);
- this.progress_bar.TabIndex = 18;
- this.progress_bar.Visible = false;
- //
// CheckForUpdatesView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(388, 403);
- this.Controls.Add(this.progress_bar);
this.Controls.Add(this.label5);
this.Controls.Add(this.ux_new_version);
this.Controls.Add(this.label3);
@@ -178,7 +168,6 @@ namespace MoMoney.Presentation.Views.updates
private System.Windows.Forms.Button ux_update_button;
private System.Windows.Forms.Label ux_new_version;
private System.Windows.Forms.Label label5;
- private System.Windows.Forms.ProgressBar progress_bar;
}
}
\ No newline at end of file
trunk/product/MyMoney/Tasks/infrastructure/updating/DisplayNextAvailableVersion.cs
@@ -1,31 +0,0 @@
-using MoMoney.Infrastructure.Threading;
-using MoMoney.Presentation.Model.updates;
-using MoMoney.Tasks.infrastructure.core;
-using MoMoney.Utility.Core;
-
-namespace MoMoney.Tasks.infrastructure.updating
-{
- public interface IDisplayNextAvailableVersion : ICallbackCommand<ApplicationVersion>
- {
- }
-
- public class DisplayNextAvailableVersion : IDisplayNextAvailableVersion
- {
- readonly IWhatIsTheAvailableVersion query;
- readonly ICommandProcessor processor;
- readonly ICommandFactory factory;
-
- public DisplayNextAvailableVersion(IWhatIsTheAvailableVersion query, ICommandProcessor processor,
- ICommandFactory factory)
- {
- this.query = query;
- this.factory = factory;
- this.processor = processor;
- }
-
- public void run(ICallback<ApplicationVersion> item)
- {
- processor.add(factory.create_for(item, query));
- }
- }
-}
\ No newline at end of file
trunk/product/MyMoney/MyMoney.csproj
@@ -609,7 +609,6 @@
<Compile Include="Tasks\infrastructure\updating\CancelUpdate.cs" />
<Compile Include="Tasks\infrastructure\updating\CancelUpdateSpecs.cs" />
<Compile Include="Tasks\infrastructure\updating\CurrentDeployment.cs" />
- <Compile Include="Tasks\infrastructure\updating\DisplayNextAvailableVersion.cs" />
<Compile Include="Tasks\infrastructure\core\ProcessQueryCommand.cs" />
<Compile Include="Tasks\infrastructure\core\RunQueryCommand.cs" />
<Compile Include="Tasks\infrastructure\updating\DownloadTheLatestVersion.cs" />
@@ -700,7 +699,6 @@
<Compile Include="Infrastructure\Logging\Log4NetLogging\Log4NetLogger.cs" />
<Compile Include="Infrastructure\Logging\Log4NetLogging\Log4NetLogFactory.cs" />
<Compile Include="Infrastructure\Logging\LogSpecs.cs" />
- <Compile Include="Presentation\Presenters\Menu\Help\AboutTheApplicationPresenterSpecs.cs" />
<Compile Include="Presentation\Presenters\Shell\NotificationIconPresenter.cs" />
<Compile Include="Presentation\Presenters\Shell\StatusBarPresenter.cs" />
<Compile Include="Presentation\Presenters\Shell\StatusBarPresenterSpecs.cs" />