Commit 83b6130
Changed files (3)
trunk
product
MyMoney
Infrastructure
transactions
Presentation
Views
Shell
trunk/product/MyMoney/Infrastructure/transactions/UnitOfWorkRegistrySpecs.cs
@@ -1,5 +1,4 @@
using developwithpassion.bdd.contexts;
-using developwithpassion.bdd.contexts;
using MoMoney.Domain.Core;
using MoMoney.Testing.MetaData;
using MoMoney.Testing.spechelpers.contexts;
@@ -8,16 +7,11 @@ using MoMoney.Testing.spechelpers.core;
namespace MoMoney.Infrastructure.transactions
{
[Concern(typeof (UnitOfWorkRegistry))]
- public abstract class behaves_like_unit_of_work_registery : concerns_for<IUnitOfWorkRegistry,UnitOfWorkRegistry>
+ public abstract class behaves_like_unit_of_work_registery : concerns_for<IUnitOfWorkRegistry, UnitOfWorkRegistry>
{
- //public override IUnitOfWorkRegistry create_sut()
- //{
- // return new UnitOfWorkRegistry(factory);
- //}
-
context c = () => { factory = the_dependency<IUnitOfWorkFactory>(); };
- protected static IUnitOfWorkFactory factory;
+ static protected IUnitOfWorkFactory factory;
}
public class when_starting_a_unit_of_work_for_a_new_type : behaves_like_unit_of_work_registery
@@ -29,7 +23,7 @@ namespace MoMoney.Infrastructure.transactions
context c = () =>
{
unit_of_work = an<IUnitOfWork<IEntity>>();
- factory.is_told_to(x => x.create_for<IEntity>()).it_will_return( unit_of_work);
+ factory.is_told_to(x => x.create_for<IEntity>()).it_will_return(unit_of_work);
};
because b = () => { result = sut.start_unit_of_work_for<IEntity>(); };
@@ -47,7 +41,7 @@ namespace MoMoney.Infrastructure.transactions
{
unit_of_work = an<IUnitOfWork<IEntity>>();
- factory.is_told_to(x => x.create_for<IEntity>()).it_will_return( unit_of_work).Repeat.Once();
+ factory.is_told_to(x => x.create_for<IEntity>()).it_will_return(unit_of_work).Repeat.Once();
};
because b = () =>
@@ -67,7 +61,7 @@ namespace MoMoney.Infrastructure.transactions
context c = () =>
{
unit_of_work = an<IUnitOfWork<IEntity>>();
- factory.is_told_to(x => x.create_for<IEntity>()).it_will_return( unit_of_work).Repeat.Once();
+ factory.is_told_to(x => x.create_for<IEntity>()).it_will_return(unit_of_work).Repeat.Once();
};
because b = () =>
trunk/product/MyMoney/Presentation/Views/Shell/ApplicationShell.cs
@@ -17,10 +17,11 @@ namespace MoMoney.Presentation.Views.Shell
InitializeComponent();
regions = new Dictionary<string, Control>
{
+ {GetType().FullName, this},
{ux_main_menu_strip.GetType().FullName, ux_main_menu_strip},
{ux_dock_panel.GetType().FullName, ux_dock_panel},
{ux_tool_bar_strip.GetType().FullName, ux_tool_bar_strip},
- {ux_status_bar.GetType().FullName, ux_status_bar}
+ {ux_status_bar.GetType().FullName, ux_status_bar},
};
}
@@ -29,13 +30,12 @@ namespace MoMoney.Presentation.Views.Shell
on_ui_thread(() => view.add_to(ux_dock_panel));
}
- public void region<T>(Action<T> action) where T : Control
+ public void region<Region>(Action<Region> action) where Region : Control
{
- ensure_that_the_region_exists<T>();
- on_ui_thread(() => action(regions[typeof (T).FullName].downcast_to<T>()));
+ ensure_that_the_region_exists<Region>();
+ on_ui_thread(() => action(regions[typeof (Region).FullName].downcast_to<Region>()));
}
-
public void close_the_active_window()
{
on_ui_thread(() => ux_dock_panel.ActiveDocument.DockHandler.Close());
@@ -52,14 +52,6 @@ namespace MoMoney.Presentation.Views.Shell
});
}
- //public void clear_menu_items()
- //{
- // on_ui_thread(() =>
- // {
- // ux_tool_bar_strip.Items.Clear();
- // ux_main_menu_strip.Items.Clear();
- // });
- //}
void ensure_that_the_region_exists<T>()
{
if (!regions.ContainsKey(typeof (T).FullName))
trunk/product/MyMoney/Presentation/Views/Shell/IShell.cs
@@ -7,10 +7,10 @@ namespace MoMoney.Presentation.Views.Shell
{
public interface IShell : IWin32Window, ISynchronizeInvoke, IContainerControl, IBindableComponent, IDropTarget
{
+ string Text { get; set; }
void add(IDockedContentView view);
void region<T>(Action<T> action) where T : Control;
void close_the_active_window();
- string Text { get; set; }
void close_all_windows();
}
}
\ No newline at end of file