Commit 5e682aa
Changed files (1)
trunk
product
MyMoney
Presentation
Views
Shell
trunk/product/MyMoney/Presentation/Views/Shell/ApplicationShell.cs
@@ -31,9 +31,11 @@ namespace MoMoney.Presentation.Views.Shell
public void region<T>(Action<T> action) where T : Control
{
+ ensure_that_the_region_exists<T>();
on_ui_thread(() => action(regions[typeof (T).FullName].downcast_to<T>()));
}
+
public void close_the_active_window()
{
on_ui_thread(() => ux_dock_panel.ActiveDocument.DockHandler.Close());
@@ -58,5 +60,12 @@ namespace MoMoney.Presentation.Views.Shell
// ux_main_menu_strip.Items.Clear();
// });
//}
+ void ensure_that_the_region_exists<T>()
+ {
+ if (!regions.ContainsKey(typeof (T).FullName))
+ {
+ throw new Exception("Could not find region: {0}".formatted_using(typeof (T)));
+ }
+ }
}
}
\ No newline at end of file