Commit d7ad224

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-04-10 22:10:24
prepping for release.
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@151 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent f4be838
trunk/build/build.bat
@@ -1,4 +1,4 @@
 @echo off
 cls
-tools\nant\nant.exe -buildfile:project.build %*
+tools\nant\nant.exe -nologo -buildfile:project.build %*
 @echo %time%
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/proxy_configuration/SynchronizedConfiguration.cs
@@ -8,7 +8,7 @@ namespace MoMoney.boot.container.registration.proxy_configuration
     {
         public void configure(IProxyBuilder<T> item)
         {
-            item.add_interceptor<ThreadSafeInterceptor>().intercept_all();
+            item.add_interceptor<RunOnUIThread>().intercept_all();
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/SynchronizedConfiguration.cs
@@ -8,7 +8,7 @@ namespace MoMoney.boot.container.registration
     {
         public void configure(IProxyBuilder<T> item)
         {
-            item.add_interceptor<ThreadSafeInterceptor>().intercept_all();
+            item.add_interceptor<RunOnUIThread>().intercept_all();
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -1,5 +1,6 @@
 using System.Reflection;
 using MoMoney.Infrastructure.Container;
+using MoMoney.Infrastructure.interceptors;
 using MoMoney.Infrastructure.reflection;
 using MoMoney.Modules.Core;
 using MoMoney.Presentation.Core;
@@ -30,8 +31,7 @@ namespace MoMoney.boot.container.registration
         public void run(IAssembly item)
         {
             registry.proxy<IApplicationController, SynchronizedConfiguration<IApplicationController>>(
-                () =>
-                new ApplicationController(resolve.dependency_for<IPresenterRegistry>(), resolve.dependency_for<IShell>()));
+                () => new ApplicationController(Lazy.load<IPresenterRegistry>(), Lazy.load<IShell>()));
             registry.transient(typeof (IRunThe<>), typeof (RunThe<>));
             registry.transient<IFileMenu, FileMenu>();
             registry.transient<IWindowMenu, WindowMenu>();
@@ -41,12 +41,14 @@ namespace MoMoney.boot.container.registration
                 .all_types()
                 .where(x => typeof (IPresenter).IsAssignableFrom(x))
                 .where(x => !x.IsInterface)
+                .where(x => !x.IsAbstract)
                 .each(type => registry.transient(typeof (IPresenter), type));
 
             item
                 .all_types()
                 .where(x => typeof (IModule).IsAssignableFrom(x))
                 .where(x => !x.IsInterface)
+                .where(x => !x.IsAbstract)
                 .each(type => registry.transient(typeof (IModule), type));
         }
     }
trunk/product/MyMoney/Infrastructure/Container/Windsor/configuration/ComponentExclusionSpecification.cs
@@ -12,6 +12,7 @@ namespace MoMoney.Infrastructure.Container.Windsor.configuration
                 .or(type.is_an_implementation_of_dependency_registry())
                 .or(type.is_an_entity())
                 .or(type.is_an_interface())
+                .or(type.is_abstract())
                 .is_satisfied_by(type);
         }
     }
trunk/product/MyMoney/Infrastructure/Container/Windsor/configuration/type_extensions.cs
@@ -5,31 +5,36 @@ using MoMoney.Utility.Core;
 
 namespace MoMoney.Infrastructure.Container.Windsor.configuration
 {
-    static public class type_extensions
+    public static class type_extensions
     {
-        static public ISpecification<Type> has_no_interfaces(this Type item)
+        public static ISpecification<Type> has_no_interfaces(this Type item)
         {
             return new PredicateSpecification<Type>(x => x.GetInterfaces().Length == 0);
         }
 
-        static public ISpecification<Type> subclasses_form(this Type item)
+        public static ISpecification<Type> subclasses_form(this Type item)
         {
             return new PredicateSpecification<Type>(x => typeof (Form).IsAssignableFrom(x));
         }
 
-        static public ISpecification<Type> is_an_implementation_of_dependency_registry(this Type item)
+        public static ISpecification<Type> is_an_implementation_of_dependency_registry(this Type item)
         {
             return new PredicateSpecification<Type>(x => typeof (IDependencyRegistry).IsAssignableFrom(x));
         }
 
-        static public ISpecification<Type> is_an_entity(this Type item)
+        public static ISpecification<Type> is_an_entity(this Type item)
         {
             return new PredicateSpecification<Type>(x => typeof (IEntity).IsAssignableFrom(x));
         }
 
-        static public ISpecification<Type> is_an_interface(this Type item)
+        public static ISpecification<Type> is_an_interface(this Type item)
         {
             return new PredicateSpecification<Type>(x => x.IsInterface);
         }
+
+        public static ISpecification<Type> is_abstract(this Type item)
+        {
+            return new PredicateSpecification<Type>(x => x.IsAbstract);
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/Threading/ThreadSafeInterceptor.cs → trunk/product/MyMoney/Infrastructure/Threading/RunOnUIThread.cs
@@ -4,19 +4,15 @@ using MoMoney.Utility.Core;
 
 namespace MoMoney.Infrastructure.Threading
 {
-    public interface IThreadSafeInterceptor : IInterceptor
-    {
-    }
-
-    public class ThreadSafeInterceptor : IThreadSafeInterceptor
+    public class RunOnUIThread : IInterceptor
     {
         readonly ISynchronizationContextFactory factory;
 
-        public ThreadSafeInterceptor() : this(Lazy.load<ISynchronizationContextFactory>())
+        public RunOnUIThread() : this(Lazy.load<ISynchronizationContextFactory>())
         {
         }
 
-        public ThreadSafeInterceptor(ISynchronizationContextFactory factory)
+        public RunOnUIThread(ISynchronizationContextFactory factory)
         {
             this.factory = factory;
         }
trunk/product/MyMoney/Infrastructure/transactions2/Database.cs
@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
@@ -45,6 +46,13 @@ namespace MoMoney.Infrastructure.transactions2
             path.copy_to(new_path);
         }
 
+        public void close(string name)
+        {
+            path.delete();
+            path = new ApplicationFile(Path.GetTempFileName());
+            
+        }
+
         IFile path_to_database()
         {
             return path;
trunk/product/MyMoney/Infrastructure/transactions2/IDatabaseConfiguration.cs
@@ -6,5 +6,6 @@ namespace MoMoney.Infrastructure.transactions2
     {
         void open(IFile file);
         void copy_to(string path);
+        void close(string name);
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Core/ContentPresenter.cs
@@ -0,0 +1,15 @@
+using MoMoney.Presentation.Views.core;
+
+namespace MoMoney.Presentation.Core
+{
+    public abstract class ContentPresenter<T> : IContentPresenter where T : IDockedContentView
+    {
+        protected ContentPresenter(T view)
+        {
+            View = view;
+        }
+
+        public abstract void run();
+        public IDockedContentView View { get; set; }
+    }
+}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Model/Projects/file.cs
@@ -8,6 +8,7 @@ namespace MoMoney.Presentation.Model.Projects
         string path { get; }
         bool does_the_file_exist();
         void copy_to(string path);
+        void delete();
     }
 
     internal class ApplicationFile : IFile
@@ -30,6 +31,11 @@ namespace MoMoney.Presentation.Model.Projects
             File.Copy(path, other_path, true);
         }
 
+        public void delete()
+        {
+            File.Delete(path);
+        }
+
         public static implicit operator ApplicationFile(string file_path)
         {
             return new ApplicationFile(file_path);
trunk/product/MyMoney/Presentation/Model/Projects/ProjectController.cs
@@ -59,6 +59,7 @@ namespace MoMoney.Presentation.Model.Projects
         public void close_project()
         {
             if (!project.is_open()) return;
+            configuration.close(project.name());
             project = new EmptyProject();
             broker.publish<ClosingProjectEvent>();
         }
trunk/product/MyMoney/Presentation/Presenters/Navigation/NavigationPresenter.cs
@@ -1,6 +1,5 @@
 using MoMoney.Presentation.Core;
 using MoMoney.Presentation.Model.Navigation;
-using MoMoney.Presentation.Views.core;
 using MoMoney.Presentation.Views.Navigation;
 
 namespace MoMoney.Presentation.Presenters.Navigation
@@ -9,25 +8,25 @@ namespace MoMoney.Presentation.Presenters.Navigation
     {
     }
 
-    public class NavigationPresenter : INavigationPresenter
+    public class NavigationPresenter : ContentPresenter<INavigationView>, INavigationPresenter
     {
         readonly INavigationView view;
         readonly INavigationTreeVisitor tree_view_visitor;
 
-        public NavigationPresenter(INavigationView view, INavigationTreeVisitor tree_view_visitor)
+        public NavigationPresenter(INavigationView view, INavigationTreeVisitor tree_view_visitor) : base(view)
         {
             this.view = view;
             this.tree_view_visitor = tree_view_visitor;
         }
 
-        public void run()
+        public override void run()
         {
             view.accept(tree_view_visitor);
         }
 
-        IDockedContentView IContentPresenter.View
-        {
-            get { return view; }
-        }
+        //IDockedContentView IContentPresenter.View
+        //{
+        //    get { return view; }
+        //}
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Navigation/NavigationView.cs
@@ -1,3 +1,4 @@
+using System;
 using System.Windows.Forms;
 using MoMoney.Presentation.Model.Navigation;
 using MoMoney.Presentation.Resources;
@@ -16,14 +17,12 @@ namespace MoMoney.Presentation.Views.Navigation
         {
             InitializeComponent();
             this.shell = shell;
-            initialize_the_ui();
         }
 
-        void initialize_the_ui()
+        protected override void OnLoad(EventArgs e)
         {
             icon(ApplicationIcons.FileExplorer)
-                .cannot_be_closed()
-                .docked_to(DockState.DockLeft);
+                .docked_to(DockState.DockRightAutoHide);
 
             uxNavigationTreeView.ImageList = new ImageList();
             ApplicationIcons.all().each(x => uxNavigationTreeView.ImageList.Images.Add(x.name_of_the_icon, x));
trunk/product/MyMoney/Presentation/Views/Navigation/NavigationView.Designer.cs
@@ -35,19 +35,21 @@ namespace MoMoney.Presentation.Views.Navigation
             // 
             this.uxNavigationTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
             this.uxNavigationTreeView.Location = new System.Drawing.Point(0, 0);
+            this.uxNavigationTreeView.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.uxNavigationTreeView.Name = "uxNavigationTreeView";
-            this.uxNavigationTreeView.Size = new System.Drawing.Size(292, 273);
+            this.uxNavigationTreeView.Size = new System.Drawing.Size(389, 336);
             this.uxNavigationTreeView.TabIndex = 0;
             // 
             // NavigationView
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(292, 273);
+            this.ClientSize = new System.Drawing.Size(389, 336);
             this.Controls.Add(this.uxNavigationTreeView);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "NavigationView";
             this.TabText = "Action Items";
-            this.Text = "Action Items";
+            this.Text = "Alternate Menu";
             this.ResumeLayout(false);
 
         }
trunk/product/MyMoney/Tasks/infrastructure/LogFileTasks.cs
@@ -27,7 +27,7 @@ namespace MoMoney.Tasks.infrastructure
 
         public string get_the_path_to_the_log_file()
         {
-            return Path.Combine(this.startup_directory(), "logs/log.txt");
+            return Path.Combine(this.startup_directory(), @"logs\log.txt");
         }
 
         //public void notify(ICallback<string> view)
trunk/product/MyMoney/MyMoney.csproj
@@ -107,10 +107,6 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\build\tools\mbunit\MbUnit.Framework.dll</HintPath>
     </Reference>
-    <Reference Include="ObjectListView, Version=2.1.0.26964, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\build\lib\app\object.list.view\ObjectListView.dll</HintPath>
-    </Reference>
     <Reference Include="PresentationCore">
       <RequiredTargetFramework>3.0</RequiredTargetFramework>
     </Reference>
@@ -309,7 +305,7 @@
     <Compile Include="Infrastructure\Threading\SynchronizationContextFactory.cs" />
     <Compile Include="Infrastructure\Threading\SynchronizedCommand.cs" />
     <Compile Include="Infrastructure\Threading\SynchronizedContext.cs" />
-    <Compile Include="Infrastructure\Threading\ThreadSafeInterceptor.cs" />
+    <Compile Include="Infrastructure\Threading\RunOnUIThread.cs" />
     <Compile Include="Infrastructure\Threading\TimerFactory.cs" />
     <Compile Include="Infrastructure\Threading\WorkerThread.cs">
       <SubType>Component</SubType>
@@ -346,6 +342,7 @@
     <Compile Include="Infrastructure\transactions\unit_of_work_specs.cs" />
     <Compile Include="Modules\ApplicationShellModule.cs" />
     <Compile Include="Modules\DatabaseModule.cs" />
+    <Compile Include="Presentation\Core\ContentPresenter.cs" />
     <Compile Include="Presentation\Core\IContentPresenter.cs" />
     <Compile Include="Presentation\Databindings\date_time_picker_property_binding.cs" />
     <Compile Include="Presentation\Databindings\date_time_property_binding_specs.cs" />