Commit 6106d8b

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-03-14 17:00:48
starting to change how unit of work starts
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@76 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent bba641e
trunk/product/MyMoney/DataAccess/db40/ConnectionFactory.cs
@@ -1,5 +1,4 @@
 using Db4objects.Db4o;
-using JetBrains.Annotations;
 using MoMoney.Infrastructure.Extensions;
 using MoMoney.Presentation.Model.Projects;
 
@@ -10,7 +9,6 @@ namespace MoMoney.DataAccess.db40
         IObjectContainer open_connection_to(IFile the_path_to_the_database_file);
     }
 
-    [UsedImplicitly]
     public class ConnectionFactory : IConnectionFactory
     {
         public IObjectContainer open_connection_to(IFile the_path_to_the_database_file)
trunk/product/MyMoney/DataAccess/db40/DatabaseConfiguration.cs
@@ -1,4 +1,3 @@
-using System.IO;
 using Castle.Core;
 using MoMoney.Presentation.Model.Projects;
 
@@ -15,11 +14,6 @@ namespace MoMoney.DataAccess.db40
     {
         ApplicationFile the_path_to_the_database_file;
 
-        public DatabaseConfiguration()
-        {
-            the_path_to_the_database_file = Path.GetTempFileName();
-        }
-
         public IFile path_to_the_database()
         {
             return the_path_to_the_database_file;
@@ -27,8 +21,9 @@ namespace MoMoney.DataAccess.db40
 
         public void change_path_to(IFile file)
         {
-            the_path_to_the_database_file = Path.GetTempFileName();
-            file.copy_to(the_path_to_the_database_file);
+            //the_path_to_the_database_file = Path.GetTempFileName();
+            //file.copy_to(the_path_to_the_database_file);
+            the_path_to_the_database_file = file.path;
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/DataAccess/db40/ObjectDatabaseGateway.cs
@@ -10,11 +10,11 @@ namespace MoMoney.DataAccess.db40
 {
     public class ObjectDatabaseGateway : IDatabaseGateway
     {
-        readonly ISessionFactory factory;
+        readonly ISessionProvider provider;
 
-        public ObjectDatabaseGateway(ISessionFactory factory)
+        public ObjectDatabaseGateway(ISessionProvider provider)
         {
-            this.factory = factory;
+            this.provider = provider;
         }
 
         public IEnumerable<T> all<T>() where T : IEntity
@@ -38,7 +38,7 @@ namespace MoMoney.DataAccess.db40
 
         IObjectContainer open_session_with_database()
         {
-            return factory.create();
+            return provider.get_session();
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/DataAccess/db40/ObjectDatabaseGatewaySpecs.cs
@@ -12,9 +12,9 @@ namespace MoMoney.DataAccess.db40
     [Concern(typeof (ObjectDatabaseGateway))]
     public abstract class behaves_like_a_object_repository : concerns_for<IDatabaseGateway, ObjectDatabaseGateway>
     {
-        context c = () => { factory = the_dependency<ISessionFactory>(); };
+        context c = () => { _provider = the_dependency<ISessionProvider>(); };
 
-        protected static ISessionFactory factory;
+        protected static ISessionProvider _provider;
     }
 
     public class when_loading_all_the_items_from_the_database : behaves_like_a_object_repository
@@ -31,7 +31,7 @@ namespace MoMoney.DataAccess.db40
                             second_item = an<IEntity>();
                             var session = an<IObjectContainer>();
 
-                            factory.is_told_to(x => x.create()).it_will_return(session);
+                            _provider.is_told_to(x => x.get_session()).it_will_return(session);
                             session.is_told_to(x => x.Query<IEntity>()).it_will_return(new List<IEntity>
                                                                                            {first_item, second_item});
                         };
trunk/product/MyMoney/DataAccess/db40/SessionFactory.cs → trunk/product/MyMoney/DataAccess/db40/SessionProvider.cs
@@ -2,23 +2,23 @@ using Db4objects.Db4o;
 
 namespace MoMoney.DataAccess.db40
 {
-    public interface ISessionFactory // : IFactory<IObjectContainer>
+    public interface ISessionProvider
     {
-        IObjectContainer create();
+        IObjectContainer get_session();
     }
 
-    public class SessionFactory : ISessionFactory
+    public class SessionProvider : ISessionProvider
     {
         readonly IDatabaseConfiguration database_configuration;
         readonly IConnectionFactory connection_factory;
 
-        public SessionFactory(IDatabaseConfiguration database_configuration, IConnectionFactory connection_factory)
+        public SessionProvider(IDatabaseConfiguration database_configuration, IConnectionFactory connection_factory)
         {
             this.database_configuration = database_configuration;
             this.connection_factory = connection_factory;
         }
 
-        public IObjectContainer create()
+        public IObjectContainer get_session()
         {
             return connection_factory.open_connection_to(database_configuration.path_to_the_database());
         }
trunk/product/MyMoney/DataAccess/db40/SessionFactorySpecs.cs → trunk/product/MyMoney/DataAccess/db40/SessionProviderSpecs.cs
@@ -1,6 +1,5 @@
 using Db4objects.Db4o;
 using developwithpassion.bdd.contexts;
-using MoMoney.DataAccess.db40;
 using MoMoney.Presentation.Model.Projects;
 using MoMoney.Testing.MetaData;
 using MoMoney.Testing.spechelpers.contexts;
@@ -8,14 +7,9 @@ using MoMoney.Testing.spechelpers.core;
 
 namespace MoMoney.DataAccess.db40
 {
-    [Concern(typeof (SessionFactory))]
-    public abstract class behaves_like_a_session_factory : concerns_for<ISessionFactory, SessionFactory>
+    [Concern(typeof (SessionProvider))]
+    public abstract class behaves_like_a_session_factory : concerns_for<ISessionProvider, SessionProvider>
     {
-        //public override ISessionFactory create_sut()
-        //{
-        //    return new SessionFactory(database_configuration, connection_factory);
-        //}
-
         context c = () =>
                         {
                             connection_factory = the_dependency<IConnectionFactory>();
@@ -36,11 +30,13 @@ namespace MoMoney.DataAccess.db40
                     var the_path_to_the_database_file = an<IFile>();
                     session = an<IObjectContainer>();
 
-                    database_configuration.is_told_to(x => x.path_to_the_database()).it_will_return( the_path_to_the_database_file);
-                    connection_factory.is_told_to(x => x.open_connection_to(the_path_to_the_database_file)). it_will_return(session);
+                    database_configuration.is_told_to(x => x.path_to_the_database()).it_will_return(
+                        the_path_to_the_database_file);
+                    connection_factory.is_told_to(x => x.open_connection_to(the_path_to_the_database_file)).
+                        it_will_return(session);
                 };
 
-        because b = () => { result = sut.create(); };
+        because b = () => { result = sut.get_session(); };
 
         static IObjectContainer result;
         static IObjectContainer session;
trunk/product/MyMoney/Presentation/Model/Projects/CurrentProject.cs
@@ -1,4 +1,3 @@
-using System.IO;
 using Castle.Core;
 using MoMoney.DataAccess.db40;
 using MoMoney.Infrastructure.eventing;
@@ -64,7 +63,6 @@ namespace MoMoney.Presentation.Model.Projects
             }
             is_project_open = true;
             current_file = null;
-            configuration.change_path_to((ApplicationFile) Path.GetTempFileName());
             changes_to_save = false;
             broker.publish(new new_project_opened(name()));
         }
@@ -76,6 +74,7 @@ namespace MoMoney.Presentation.Model.Projects
                 return;
             }
             current_file = new_file;
+            configuration.change_path_to(new_file);
             save_changes();
         }
 
@@ -87,7 +86,6 @@ namespace MoMoney.Presentation.Model.Projects
         public void save_changes()
         {
             ensure_that_a_path_to_save_to_has_been_specified();
-            configuration.path_to_the_database().copy_to(current_file);
             changes_to_save = false;
             broker.publish<saved_changes_event>();
         }
trunk/product/MyMoney/Presentation/Model/Projects/CurrentProjectSpecs.cs
@@ -25,18 +25,15 @@ namespace MoMoney.Presentation.Model.Projects
 
     public class when_saving_the_current_project : behaves_like_a_project
     {
-        it should_save_the_current_database_to_the_path_specified_by_the_user =
-            () => current_file.was_told_to(x => x.copy_to(file_to_update));
+        it should_notify_the_rest_of_the_application = () => broker.was_told_to(x => x.publish<saved_changes_event>());
 
         context c = () =>
                         {
                             file_to_update = an<IFile>();
                             current_file = an<IFile>();
 
-                            when_the(configuration).is_told_to(x => x.path_to_the_database()).
-                                it_will_return(current_file);
-                            when_the(file_to_update).is_told_to(x => x.does_the_file_exist()).
-                                it_will_return(true);
+                            when_the(configuration).is_told_to(x => x.path_to_the_database()). it_will_return(current_file);
+                            when_the(file_to_update).is_told_to(x => x.does_the_file_exist()). it_will_return(true);
                         };
 
         because b = () =>
@@ -61,17 +58,13 @@ namespace MoMoney.Presentation.Model.Projects
 
     public class when_specifying_a_new_path_to_save_an_opened_project_to : behaves_like_a_project
     {
-        it should_save_the_current_database_to_the_new_path =
-            () => database_file.was_told_to(x => x.copy_to(new_file));
+        it should_save_the_current_database_to_the_new_path = () => configuration.was_told_to(x => x.change_path_to(new_file));
 
         context c = () =>
                         {
                             original_file = an<IFile>();
                             new_file = an<IFile>();
                             database_file = an<IFile>();
-
-                            when_the(configuration).is_told_to(x => x.path_to_the_database()).
-                                it_will_return(database_file);
                             when_the(new_file).is_told_to(x => x.path).it_will_return("blah");
                         };
 
trunk/product/MyMoney/Presentation/Presenters/Shell/LogFilePresenter.cs
@@ -22,7 +22,7 @@ namespace MoMoney.Presentation.Presenters.Shell
 
         public void run()
         {
-            view.display(tasks.get_the_contents_of_the_log_file());
+            view.display(tasks.get_the_path_to_the_log_file(), tasks.get_the_contents_of_the_log_file());
         }
 
         IDockedContentView IContentPresenter.View
trunk/product/MyMoney/Presentation/Presenters/Shell/LogFileViewPresenterSpecs.cs
@@ -20,16 +20,19 @@ namespace MoMoney.Presentation.Presenters.Shell
 
     public class when_displaying_the_log_file : behaves_like_log_file_presenter
     {
-        it should_display_the_contents_of_the_log_file = () => view.was_told_to(x => x.display(log_file_contents));
+        it should_display_the_contents_of_the_log_file = () => view.was_told_to(x => x.display(log_file_path, log_file_contents));
 
         context c = () =>
                         {
+                            log_file_path = "log.txt";
                             log_file_contents = "hello_jello";
+                            tasks.is_told_to(x => x.get_the_path_to_the_log_file()).it_will_return(log_file_path);
                             tasks.is_told_to(x => x.get_the_contents_of_the_log_file()).it_will_return(log_file_contents);
                         };
 
         because b = () => sut.run();
 
         static string log_file_contents;
+        static string log_file_path;
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/StatusBarPresenter.cs
@@ -11,7 +11,8 @@ namespace MoMoney.Presentation.Presenters.Shell
     public interface IStatusBarPresenter : IPresentationModule,
                                            IEventSubscriber<saved_changes_event>,
                                            IEventSubscriber<new_project_opened>,
-                                           IEventSubscriber<closing_the_application>
+                                           IEventSubscriber<closing_the_application>,
+                                           IEventSubscriber<closing_project_event>
     {
     }
 
@@ -31,6 +32,7 @@ namespace MoMoney.Presentation.Presenters.Shell
             broker.subscribe_to<saved_changes_event>(this);
             broker.subscribe_to<new_project_opened>(this);
             broker.subscribe_to<closing_the_application>(this);
+            broker.subscribe_to<closing_project_event>(this);
         }
 
         public void notify(saved_changes_event message)
@@ -47,5 +49,10 @@ namespace MoMoney.Presentation.Presenters.Shell
         {
             view.display(ApplicationIcons.Empty, "Good Bye!");
         }
+
+        public void notify(closing_project_event message)
+        {
+            view.display(ApplicationIcons.ApplicationReady, "Ready");
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/UnhandledErrorPresenter.cs
@@ -1,23 +1,27 @@
 using MoMoney.Infrastructure.eventing;
-using MoMoney.Infrastructure.Extensions;
 using MoMoney.Presentation.Core;
 using MoMoney.Presentation.Model.messages;
+using MoMoney.Presentation.Presenters.Commands;
 using MoMoney.Presentation.Views.Shell;
 
 namespace MoMoney.Presentation.Presenters.Shell
 {
-    public interface IUnhandledErrorPresenter : IPresentationModule, IPresenter, IEventSubscriber<unhandled_error_occurred>
+    public interface IUnhandledErrorPresenter : IPresentationModule, IPresenter,
+                                                IEventSubscriber<unhandled_error_occurred>
     {
+        void restart_application();
     }
 
     public class UnhandledErrorPresenter : IUnhandledErrorPresenter
     {
         readonly IUnhandledErrorView view;
         readonly IEventAggregator broker;
+        readonly IRestartCommand restart;
 
-        public UnhandledErrorPresenter(IUnhandledErrorView view, IEventAggregator broker)
+        public UnhandledErrorPresenter(IUnhandledErrorView view, IEventAggregator broker, IRestartCommand command)
         {
             this.view = view;
+            restart = command;
             this.broker = broker;
         }
 
@@ -28,8 +32,12 @@ namespace MoMoney.Presentation.Presenters.Shell
 
         public void notify(unhandled_error_occurred message)
         {
-            this.log().debug("received error");
             view.display(message.error);
         }
+
+        public void restart_application()
+        {
+            restart.run();
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/core/ApplicationDockedWindow.cs
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Windows.Forms;
 using MoMoney.Presentation.Resources;
+using MoMoney.Utility.Extensions;
 using WeifenLuo.WinFormsUI.Docking;
 
 namespace MoMoney.Presentation.Views.core
@@ -8,7 +9,7 @@ namespace MoMoney.Presentation.Views.core
     public interface IApplicationDockedWindow : IDockedContentView
     {
         IApplicationDockedWindow create_tool_tip_for(string title, string caption, Control control);
-        IApplicationDockedWindow titled(string title);
+        IApplicationDockedWindow titled(string title, params object[] arguments);
         IApplicationDockedWindow icon(ApplicationIcon icon);
         IApplicationDockedWindow cannot_be_closed();
         IApplicationDockedWindow docked_to(DockState state);
@@ -32,9 +33,9 @@ namespace MoMoney.Presentation.Views.core
             return this;
         }
 
-        public IApplicationDockedWindow titled(string title)
+        public IApplicationDockedWindow titled(string title, params object[] arguments)
         {
-            TabText = title;
+            TabText = title.formatted_using(arguments);
             return this;
         }
 
@@ -67,7 +68,7 @@ namespace MoMoney.Presentation.Views.core
             DockState = dock_state;
         }
 
-        void remove_from(DockPanel panel)
+        public void remove_from(DockPanel panel)
         {
             var panel_to_remove = get_window_from(panel);
             panel_to_remove.DockHandler.Close();
trunk/product/MyMoney/Presentation/Views/dialogs/SaveChangesView.cs
@@ -20,7 +20,7 @@ namespace MoMoney.Presentation.Views.dialogs
 
             titled("Unsaved Changes")
                 .create_tool_tip_for("Save", "Save the document, and then close it.", save_button)
-                .create_tool_tip_for("Don't Save", "Discard the unsaved changes.", do_not_save_button)
+                .create_tool_tip_for("Don't Save", "Discard any unsaved changes.", do_not_save_button)
                 .create_tool_tip_for("Cancel", "Go back.", cancel_button);
         }
 
trunk/product/MyMoney/Presentation/Views/Navigation/MainMenuView.cs
@@ -30,7 +30,7 @@ namespace MoMoney.Presentation.Views.Navigation
 
         public void display()
         {
-            shell.add(this);
+            shell.region<DockPanel>(x => add_to(x));
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/ILogFileView.cs
@@ -4,6 +4,6 @@ namespace MoMoney.Presentation.Views.Shell
 {
     public interface ILogFileView : IDockedContentView
     {
-        void display(string contents);
+        void display(string file_path, string file_contents);
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/LogFileView.cs
@@ -9,9 +9,10 @@ namespace MoMoney.Presentation.Views.Shell
             InitializeComponent();
         }
 
-        public void display(string contents)
+        public void display(string file_path, string file_contents)
         {
-            ux_log_file.Text = contents;
+            titled("Log File - {0}", file_path);
+            ux_log_file.Text = file_contents;
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/StatusBarView.cs
@@ -14,10 +14,6 @@ namespace MoMoney.Presentation.Views.Shell
 
         public void display(HybridIcon icon_to_display, string text_to_display)
         {
-            //shell.status_bar().Items.Clear();
-            //shell.status_bar().Items.Add(icon_to_display);
-            //shell.status_bar().Items.Add(text_to_display);
-
             shell.region<StatusStrip>(x =>
                                           {
                                               x.Items.Clear();
trunk/product/MyMoney/Presentation/Views/Shell/UnhandledErrorView.cs
@@ -1,5 +1,7 @@
 using System;
+using System.Windows.Forms;
 using MoMoney.Presentation.Presenters.Shell;
+using MoMoney.Presentation.Resources;
 using MoMoney.Presentation.Views.core;
 
 namespace MoMoney.Presentation.Views.Shell
@@ -9,11 +11,18 @@ namespace MoMoney.Presentation.Views.Shell
         public UnhandledErrorView()
         {
             InitializeComponent();
-            titled("Aw snap... an error occurred");
+            ux_image.Image = ApplicationImages.Splash;
+            ux_image.SizeMode = PictureBoxSizeMode.StretchImage;
+            titled("Aw snap... something went wrong!")
+                .create_tool_tip_for("Ignore", "Ignore the error and continue working.", close_button)
+                .create_tool_tip_for("Restart", "Discard any unsaved changes and restart the application.",
+                                     restart_button);
         }
 
         public void attach_to(IUnhandledErrorPresenter presenter)
         {
+            close_button.Click += (sender, args) => Close();
+            restart_button.Click += (sender, args) => presenter.restart_application();
         }
 
         public void display(Exception exception)
@@ -22,8 +31,7 @@ namespace MoMoney.Presentation.Views.Shell
                              {
                                  ux_message.Text = exception.ToString();
                                  ShowDialog();
-                             }
-                );
+                             });
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/UnhandledErrorView.Designer.cs
@@ -29,20 +29,53 @@
         private void InitializeComponent()
         {
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.ux_message = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.ux_image = new System.Windows.Forms.PictureBox();
+            this.restart_button = new System.Windows.Forms.Button();
+            this.close_button = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ux_image)).BeginInit();
             this.SuspendLayout();
             // 
             // groupBox1
             // 
-            this.groupBox1.Controls.Add(this.ux_message);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.groupBox2);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.ux_image);
+            this.groupBox1.Controls.Add(this.restart_button);
+            this.groupBox1.Controls.Add(this.close_button);
             this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.groupBox1.Location = new System.Drawing.Point(0, 0);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(709, 467);
+            this.groupBox1.Size = new System.Drawing.Size(736, 467);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(188, 50);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(366, 17);
+            this.label1.TabIndex = 11;
+            this.label1.Text = "I\'m really sorry, but something crashed in the application.";
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.ux_message);
+            this.groupBox2.Location = new System.Drawing.Point(12, 211);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(715, 250);
+            this.groupBox2.TabIndex = 10;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "The gory details...";
+            // 
             // ux_message
             // 
             this.ux_message.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -50,20 +83,65 @@
             this.ux_message.Multiline = true;
             this.ux_message.Name = "ux_message";
             this.ux_message.ReadOnly = true;
-            this.ux_message.Size = new System.Drawing.Size(703, 446);
+            this.ux_message.Size = new System.Drawing.Size(709, 229);
             this.ux_message.TabIndex = 0;
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(188, 67);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(177, 17);
+            this.label2.TabIndex = 9;
+            this.label2.Text = "What would you like to do?";
+            // 
+            // ux_image
+            // 
+            this.ux_image.Location = new System.Drawing.Point(9, 13);
+            this.ux_image.Margin = new System.Windows.Forms.Padding(4);
+            this.ux_image.Name = "ux_image";
+            this.ux_image.Size = new System.Drawing.Size(153, 105);
+            this.ux_image.TabIndex = 8;
+            this.ux_image.TabStop = false;
+            // 
+            // restart_button
+            // 
+            this.restart_button.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.restart_button.Location = new System.Drawing.Point(373, 126);
+            this.restart_button.Margin = new System.Windows.Forms.Padding(4);
+            this.restart_button.Name = "restart_button";
+            this.restart_button.Size = new System.Drawing.Size(356, 78);
+            this.restart_button.TabIndex = 3;
+            this.restart_button.Text = "I want to &Restart the application";
+            this.restart_button.UseVisualStyleBackColor = true;
+            // 
+            // close_button
+            // 
+            this.close_button.Location = new System.Drawing.Point(9, 126);
+            this.close_button.Margin = new System.Windows.Forms.Padding(4);
+            this.close_button.Name = "close_button";
+            this.close_button.Size = new System.Drawing.Size(356, 78);
+            this.close_button.TabIndex = 2;
+            this.close_button.Text = "&Ignore and continue";
+            this.close_button.UseVisualStyleBackColor = true;
+            // 
             // UnhandledErrorView
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(709, 467);
+            this.CausesValidation = false;
+            this.ClientSize = new System.Drawing.Size(736, 467);
             this.Controls.Add(this.groupBox1);
             this.Name = "UnhandledErrorView";
+            this.ShowInTaskbar = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "UnhandledErrorView";
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ux_image)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -71,6 +149,12 @@
         #endregion
 
         private System.Windows.Forms.GroupBox groupBox1;
+        public System.Windows.Forms.Button close_button;
+        public System.Windows.Forms.Button restart_button;
+        private System.Windows.Forms.Label label2;
+        public System.Windows.Forms.PictureBox ux_image;
+        private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.TextBox ux_message;
+        private System.Windows.Forms.Label label1;
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Tasks/infrastructure/LogFileTasks.cs
@@ -6,14 +6,14 @@ namespace MoMoney.Tasks.infrastructure
     public interface ILogFileTasks
     {
         string get_the_contents_of_the_log_file();
+        string get_the_path_to_the_log_file();
     }
 
     public class LogFileTasks : ILogFileTasks
     {
         public string get_the_contents_of_the_log_file()
         {
-            var log_file_path = Path.Combine(this.startup_directory(), "logs/log.txt");
-            using (var file_stream = new FileStream(log_file_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+            using ( var file_stream = new FileStream(get_the_path_to_the_log_file(), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
             {
                 using (var reader = new StreamReader(file_stream))
                 {
@@ -21,5 +21,10 @@ namespace MoMoney.Tasks.infrastructure
                 }
             }
         }
+
+        public string get_the_path_to_the_log_file()
+        {
+            return Path.Combine(this.startup_directory(), "logs/log.txt");
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/MyMoney.csproj
@@ -171,8 +171,8 @@
     <Compile Include="Domain\Core\Entity.cs" />
     <Compile Include="Domain\Core\date.cs" />
     <Compile Include="DataAccess\core\IDatabaseGateway.cs" />
-    <Compile Include="DataAccess\db40\SessionFactory.cs" />
-    <Compile Include="DataAccess\db40\SessionFactorySpecs.cs" />
+    <Compile Include="DataAccess\db40\SessionProvider.cs" />
+    <Compile Include="DataAccess\db40\SessionProviderSpecs.cs" />
     <Compile Include="Domain\accounting\billing\billing_extensions.cs" />
     <Compile Include="Domain\accounting\billing\Company.cs" />
     <Compile Include="Domain\accounting\billing\company_specs.cs" />