Commit feb8c7b

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-04-20 13:24:28
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@180 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent 5a6d396
Changed files (48)
trunk/product/Gorilla.Commons.Infrastructure/Container/Resolve.cs
@@ -13,7 +13,7 @@ namespace Gorilla.Commons.Infrastructure.Container
             initialized = registry != null;
         }
 
-        static public DependencyToResolve dependency_for<DependencyToResolve>()
+        static public DependencyToResolve a<DependencyToResolve>()
         {
             try
             {
trunk/product/Gorilla.Commons.Infrastructure/Container/ResolveSpecs.cs
@@ -20,7 +20,7 @@ namespace Gorilla.Commons.Infrastructure.Container
                             Resolve.initialize_with(registry);
                         };
 
-        because b = () => { result = Resolve.dependency_for<ICommand>(); };
+        because b = () => { result = Resolve.a<ICommand>(); };
 
         it should_leverage_the_underlying_container_it_was_initialized_with =
             () => registry.was_told_to(x => x.get_a<ICommand>());
@@ -43,7 +43,7 @@ namespace Gorilla.Commons.Infrastructure.Container
                             Resolve.initialize_with(registry);
                         };
 
-        because b = () => { the_call = call.to(() => Resolve.dependency_for<ICommand>()); };
+        because b = () => { the_call = call.to(() => Resolve.a<ICommand>()); };
 
         after_each_observation a = () => Resolve.initialize_with(null);
 
trunk/product/Gorilla.Commons.Infrastructure/Logging/Log.cs
@@ -15,7 +15,7 @@ namespace Gorilla.Commons.Infrastructure.Logging
         {
             try
             {
-                return Resolve.dependency_for<ILogFactory>().create_for(type_to_create_a_logger_for);
+                return Resolve.a<ILogFactory>().create_for(type_to_create_a_logger_for);
             }
             catch
             {
trunk/product/Gorilla.Commons.Infrastructure/Transactions/ChangeTracker.cs
@@ -24,6 +24,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public void register(T entity)
         {
+            this.log().debug("registered: {0}", entity);
             items.Add(mapper.map_from(entity));
         }
 
@@ -41,6 +42,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public bool is_dirty()
         {
+            this.log().debug("is change tracker dirty? {0}",items.Count(x => x.has_changes()) );
             return items.Count(x => x.has_changes()) > 0 || to_be_deleted.Count > 0;
         }
 
trunk/product/Gorilla.Commons.Infrastructure/Transactions/Context.cs
@@ -2,14 +2,6 @@ using System.Collections;
 
 namespace Gorilla.Commons.Infrastructure.Transactions
 {
-    public interface IContext
-    {
-        bool contains<T>(IKey<T> key);
-        void add<T>(IKey<T> key, T value);
-        T value_for<T>(IKey<T> key);
-        void remove<T>(IKey<T> key);
-    }
-
     public class Context : IContext
     {
         readonly IDictionary items;
trunk/product/Gorilla.Commons.Infrastructure/Transactions/EmptyUnitOfWork.cs
@@ -1,9 +1,12 @@
+using Gorilla.Commons.Infrastructure.Logging;
+
 namespace Gorilla.Commons.Infrastructure.Transactions
 {
     public class EmptyUnitOfWork : IUnitOfWork
     {
         public void commit()
         {
+            this.log().debug("committed empty unit of work");
         }
 
         public bool is_dirty()
trunk/product/Gorilla.Commons.Infrastructure/Transactions/IContext.cs
@@ -0,0 +1,10 @@
+namespace Gorilla.Commons.Infrastructure.Transactions
+{
+    public interface IContext
+    {
+        bool contains<T>(IKey<T> key);
+        void add<T>(IKey<T> key, T value);
+        T value_for<T>(IKey<T> key);
+        void remove<T>(IKey<T> key);
+    }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure/Transactions/IKey.cs
@@ -0,0 +1,12 @@
+using System.Collections;
+
+namespace Gorilla.Commons.Infrastructure.Transactions
+{
+    public interface IKey<T>
+    {
+        bool is_found_in(IDictionary items);
+        T parse_from(IDictionary items);
+        void remove_from(IDictionary items);
+        void add_value_to(IDictionary items, T value);
+    }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure/Transactions/PerThread.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace Gorilla.Commons.Infrastructure.Transactions
+{
+    public class PerThread : IContext
+    {
+        readonly IDictionary<int, LocalDataStoreSlot> slots;
+        readonly object mutex = new object();
+
+        public PerThread()
+        {
+            slots = new Dictionary<int, LocalDataStoreSlot>();
+        }
+
+        public bool contains<T>(IKey<T> key)
+        {
+            return key.is_found_in(get_items());
+        }
+
+        public void add<T>(IKey<T> key, T value)
+        {
+            key.add_value_to(get_items(), value);
+        }
+
+        public T value_for<T>(IKey<T> key)
+        {
+            return key.parse_from(get_items());
+        }
+
+        public void remove<T>(IKey<T> key)
+        {
+            key.remove_from(get_items());
+        }
+
+        IDictionary get_items()
+        {
+            var id = Thread.CurrentThread.ManagedThreadId;
+            within_lock(() =>
+                            {
+                                if (!slots.ContainsKey(id))
+                                {
+                                    var slot = Thread.GetNamedDataSlot(GetType().FullName);
+                                    slots.Add(id, slot);
+                                    Thread.SetData(slot, new Hashtable());
+                                }
+                            });
+            return (IDictionary) Thread.GetData(slots[id]);
+        }
+
+        void within_lock(Action action)
+        {
+            lock (mutex) action();
+        }
+    }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure/Transactions/Session.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Gorilla.Commons.Infrastructure.Logging;
 using Gorilla.Commons.Utility.Core;
 using Gorilla.Commons.Utility.Extensions;
 
@@ -21,12 +22,14 @@ namespace Gorilla.Commons.Infrastructure.Transactions
         ITransaction transaction;
         readonly IDatabase database;
         readonly IDictionary<Type, object> identity_maps;
+        long id;
 
         public Session(ITransaction transaction, IDatabase database)
         {
             this.database = database;
             this.transaction = transaction;
             identity_maps = new Dictionary<Type, object>();
+            id = DateTime.Now.Ticks;
         }
 
         public T find<T>(Guid id) where T : IIdentifiable<Guid>
@@ -52,6 +55,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public void save<T>(T entity) where T : IIdentifiable<Guid>
         {
+            this.log().debug("saving {0}: {1}", id, entity);
             get_identity_map_for<T>().add(entity.id, entity);
         }
 
@@ -62,12 +66,14 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public void flush()
         {
+            this.log().debug("flushing session {0}", id);
             transaction.commit_changes();
             transaction = null;
         }
 
         public bool is_dirty()
         {
+            this.log().debug("is dirty? {0}", id);
             return null != transaction && transaction.is_dirty();
         }
 
@@ -89,5 +95,10 @@ namespace Gorilla.Commons.Infrastructure.Transactions
             identity_maps.Add(typeof (T), identity_map);
             return identity_map;
         }
+
+        public override string ToString()
+        {
+            return "session: {0}".formatted_using(id);
+        }
     }
 }
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure/Transactions/TrackerEntry.cs
@@ -23,6 +23,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public bool has_changes()
         {
+            this.log().debug("checking for changes");
             var type = original.GetType();
             foreach (var field in type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
             {
@@ -30,12 +31,12 @@ namespace Gorilla.Commons.Infrastructure.Transactions
                 var current_value = field.GetValue(current);
                 if (original_value == null && current_value != null)
                 {
-                    this.log().debug("has changes: {0}", original);
+                    this.log().debug("{0} has changes: {1}", field, original);
                     return true;
                 }
                 if (original_value != null && !original_value.Equals(current_value))
                 {
-                    this.log().debug("has changes: {0}", original);
+                    this.log().debug("{0} has changes: {1}", field, original);
                     return true;
                 }
             }
trunk/product/Gorilla.Commons.Infrastructure/Transactions/Transaction.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Gorilla.Commons.Infrastructure.Logging;
 using Gorilla.Commons.Utility.Core;
 using Gorilla.Commons.Utility.Extensions;
 
@@ -45,6 +46,8 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public bool is_dirty()
         {
+            this.log().debug("changes trackers {0}", change_trackers.Count);
+            this.log().debug("is transaction dirty? {0}", change_trackers.Values.Count(x => x.is_dirty()));
             return change_trackers.Values.Count(x => x.is_dirty()) > 0;
         }
 
trunk/product/Gorilla.Commons.Infrastructure/Transactions/TypedKey.cs
@@ -2,14 +2,6 @@ using System.Collections;
 
 namespace Gorilla.Commons.Infrastructure.Transactions
 {
-    public interface IKey<T>
-    {
-        bool is_found_in(IDictionary items);
-        T parse_from(IDictionary items);
-        void remove_from(IDictionary items);
-        void add_value_to(IDictionary items, T value);
-    }
-
     public class TypedKey<T> : IKey<T>
     {
         public bool is_found_in(IDictionary items)
trunk/product/Gorilla.Commons.Infrastructure/Transactions/UnitOfWork.cs
@@ -1,4 +1,5 @@
 using System;
+using Gorilla.Commons.Infrastructure.Logging;
 
 namespace Gorilla.Commons.Infrastructure.Transactions
 {
@@ -28,6 +29,7 @@ namespace Gorilla.Commons.Infrastructure.Transactions
 
         public bool is_dirty()
         {
+            this.log().debug("is session dirty? {0}", session.is_dirty());
             return session.is_dirty();
         }
 
trunk/product/MoMoney.Service/Infrastructure/Core/CommandFactory.cs → trunk/product/Gorilla.Commons.Infrastructure/CommandFactory.cs
@@ -1,6 +1,6 @@
 using Gorilla.Commons.Utility.Core;
 
-namespace MoMoney.Tasks.infrastructure.core
+namespace Gorilla.Commons.Infrastructure
 {
     public interface ICommandFactory
     {
trunk/product/MoMoney.Service/Infrastructure/Core/CommandPump.cs → trunk/product/Gorilla.Commons.Infrastructure/CommandPump.cs
@@ -2,7 +2,7 @@ using Gorilla.Commons.Infrastructure.Container;
 using Gorilla.Commons.Infrastructure.Threading;
 using Gorilla.Commons.Utility.Core;
 
-namespace MoMoney.Tasks.infrastructure.core
+namespace Gorilla.Commons.Infrastructure
 {
     public interface ICommandPump
     {
trunk/product/Gorilla.Commons.Infrastructure/Gorilla.Commons.Infrastructure.csproj
@@ -66,6 +66,8 @@
     <Compile Include="Cloning\ISerializer.cs" />
     <Compile Include="Cloning\Prototype.cs" />
     <Compile Include="Cloning\Serializer.cs" />
+    <Compile Include="CommandFactory.cs" />
+    <Compile Include="CommandPump.cs" />
     <Compile Include="Container\DependencyResolutionException.cs" />
     <Compile Include="Container\IDependencyRegistry.cs" />
     <Compile Include="Container\Resolve.cs" />
@@ -77,6 +79,7 @@
     <Compile Include="Eventing\IEventSubscriber.cs" />
     <Compile Include="FileSystem\ApplicationFile.cs" />
     <Compile Include="FileSystem\IFile.cs" />
+    <Compile Include="ICallbackCommand.cs" />
     <Compile Include="Logging\Console\ConsoleLogger.cs" />
     <Compile Include="Logging\ILogFactory.cs" />
     <Compile Include="Logging\ILoggable.cs" />
@@ -84,6 +87,7 @@
     <Compile Include="Logging\Log.cs" />
     <Compile Include="Logging\LoggingExtensions.cs" />
     <Compile Include="Logging\LogSpecs.cs" />
+    <Compile Include="ProcessQueryCommand.cs" />
     <Compile Include="Proxies\ExceptionExtensions.cs" />
     <Compile Include="Proxies\IInterceptor.cs" />
     <Compile Include="Proxies\IInvocation.cs" />
@@ -96,6 +100,7 @@
     <Compile Include="Reflection\IAssembly.cs" />
     <Compile Include="Registries\DefaultRegistry.cs" />
     <Compile Include="Registries\DefaultRegistrySpecs.cs" />
+    <Compile Include="RunQueryCommand.cs" />
     <Compile Include="Threading\AsynchronousCommandProcessor.cs" />
     <Compile Include="Threading\BackgroundThread.cs" />
     <Compile Include="Threading\BackgroundThreadFactory.cs" />
@@ -128,13 +133,16 @@
     <Compile Include="Transactions\EmptyUnitOfWork.cs" />
     <Compile Include="Transactions\IChangeTracker.cs" />
     <Compile Include="Transactions\IChangeTrackerFactory.cs" />
+    <Compile Include="Transactions\IContext.cs" />
     <Compile Include="Transactions\IDatabase.cs" />
     <Compile Include="Transactions\IDatabaseConnection.cs" />
     <Compile Include="Transactions\IdentityMapProxy.cs" />
     <Compile Include="Transactions\IdentityMapSpecs.cs" />
     <Compile Include="Transactions\IIdentityMap.cs" />
+    <Compile Include="Transactions\IKey.cs" />
     <Compile Include="Transactions\IStatement.cs" />
     <Compile Include="Transactions\IStatementRegistry.cs" />
+    <Compile Include="Transactions\PerThread.cs" />
     <Compile Include="Transactions\Session.cs" />
     <Compile Include="Transactions\SessionFactory.cs" />
     <Compile Include="Transactions\SessionFactorySpecs.cs" />
trunk/product/MoMoney.Service/Infrastructure/Core/ICallbackCommand.cs → trunk/product/Gorilla.Commons.Infrastructure/ICallbackCommand.cs
@@ -1,6 +1,6 @@
 using Gorilla.Commons.Utility.Core;
 
-namespace MoMoney.Tasks.infrastructure.core
+namespace Gorilla.Commons.Infrastructure
 {
     public interface ICallbackCommand<T> : IParameterizedCommand<ICallback<T>>
     {
trunk/product/MoMoney.Service/Infrastructure/Core/ProcessQueryCommand.cs → trunk/product/Gorilla.Commons.Infrastructure/ProcessQueryCommand.cs
@@ -1,6 +1,6 @@
 using Gorilla.Commons.Utility.Core;
 
-namespace MoMoney.Tasks.infrastructure.core
+namespace Gorilla.Commons.Infrastructure
 {
     public interface IProcessQueryCommand<T> : IParameterizedCommand<ICallback<T>>
     {
trunk/product/MoMoney.Service/Infrastructure/Core/RunQueryCommand.cs → trunk/product/Gorilla.Commons.Infrastructure/RunQueryCommand.cs
@@ -1,6 +1,6 @@
 using Gorilla.Commons.Utility.Core;
 
-namespace MoMoney.Tasks.infrastructure.core
+namespace Gorilla.Commons.Infrastructure
 {
     public interface IRunQueryCommand<T> : ICommand
     {
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/UnitOfWorkInterceptor.cs
@@ -28,6 +28,7 @@ namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
                 this.log().debug("intercepting: {0}", invocation);
                 invocation.Proceed();
                 broker.publish<ICallback<IUnitOfWork>>(x => x.run(unit_of_work));
+                this.log().debug("committing unit of work");
                 unit_of_work.commit();
             }
         }
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Lazy.cs
@@ -16,7 +16,7 @@ namespace Gorilla.Commons.Infrastructure
 
         static IInterceptor create_interceptor_for<T>() where T : class
         {
-            Func<T> get_the_implementation = Resolve.dependency_for<T>;
+            Func<T> get_the_implementation = Resolve.a<T>;
             return new LazyLoadedInterceptor<T>(get_the_implementation.memorize());
         }
 
trunk/product/Gorilla.Commons.Windows.Forms/Helpers/ButtonExtensions.cs
@@ -24,7 +24,7 @@ namespace Gorilla.Commons.Windows.Forms.Helpers
 
         static public Button will_execute<Command>(this Button button, Func<bool> when) where Command : ICommand
         {
-            button.Click += (sender, e) => { if (when()) Resolve.dependency_for<Command>().run(); };
+            button.Click += (sender, e) => { if (when()) Resolve.a<Command>().run(); };
             button.Enabled = when();
             return button;
         }
trunk/product/Gorilla.Commons.Windows.Forms.ThirdParty/Krypton/ListboxExtensions.cs
@@ -2,7 +2,7 @@ using System.Collections.Generic;
 using ComponentFactory.Krypton.Toolkit;
 using Gorilla.Commons.Utility.Extensions;
 
-namespace MoMoney.Presentation.Databindings
+namespace Gorilla.Commons.Windows.Forms.Krypton
 {
     static public class ListboxExtensions
     {
trunk/product/Gorilla.Commons.Windows.Forms.ThirdParty/Gorilla.Commons.Windows.Forms.ThirdParty.csproj
@@ -8,7 +8,7 @@
     <ProjectGuid>{8050731D-48B2-4636-9D1C-2B6D052F39DC}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Gorilla.Commons.Windows.Forms.ThirdParty</RootNamespace>
+    <RootNamespace>Gorilla.Commons.Windows.Forms</RootNamespace>
     <AssemblyName>Gorilla.Commons.Windows.Forms.ThirdParty</AssemblyName>
     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
trunk/product/MoMoney.DataAccess/ObjectDatabase.cs
@@ -5,7 +5,6 @@ using System.Linq;
 using Gorilla.Commons.Infrastructure.FileSystem;
 using Gorilla.Commons.Infrastructure.Transactions;
 using Gorilla.Commons.Utility.Core;
-using MoMoney.Domain.Core;
 
 namespace MoMoney.DataAccess
 {
trunk/product/MoMoney.Presentation/Model/Menu/create.cs
@@ -6,7 +6,7 @@ namespace MoMoney.Presentation.Model.Menu
     {
         public static IMenuItemBuilder a_menu_item()
         {
-            return Resolve.dependency_for<IMenuItemBuilder>();
+            return Resolve.a<IMenuItemBuilder>();
         }
 
         public static IMenuItem a_menu_item_separator()
@@ -16,7 +16,7 @@ namespace MoMoney.Presentation.Model.Menu
 
         public static IToolbarItemBuilder a_tool_bar_item()
         {
-            return Resolve.dependency_for<IToolbarItemBuilder>();
+            return Resolve.a<IToolbarItemBuilder>();
         }
     }
 }
\ No newline at end of file
trunk/product/MoMoney.Presentation/Presenters/Billing/AddBillPaymentPresenter.cs
@@ -1,10 +1,10 @@
 using System.Collections.Generic;
+using Gorilla.Commons.Infrastructure;
 using MoMoney.Domain.accounting.billing;
 using MoMoney.Presentation.Core;
 using MoMoney.Presentation.Presenters.billing.dto;
 using MoMoney.Presentation.Views.billing;
 using MoMoney.Tasks.application;
-using MoMoney.Tasks.infrastructure.core;
 
 namespace MoMoney.Presentation.Presenters.billing
 {
trunk/product/MoMoney.Presentation/Presenters/Shell/LogFilePresenter.cs
@@ -1,6 +1,6 @@
 using MoMoney.Presentation.Core;
 using MoMoney.Presentation.Views.Shell;
-using MoMoney.Tasks.infrastructure;
+using MoMoney.Service.Infrastructure.Logging;
 
 namespace MoMoney.Presentation.Presenters.Shell
 {
trunk/product/MoMoney.Presentation/Presenters/Shell/LogFileViewPresenterSpecs.cs
@@ -1,7 +1,7 @@
 using developwithpassion.bdd.contexts;
 using Gorilla.Commons.Testing;
 using MoMoney.Presentation.Views.Shell;
-using MoMoney.Tasks.infrastructure;
+using MoMoney.Service.Infrastructure.Logging;
 
 namespace MoMoney.Presentation.Presenters.Shell
 {
trunk/product/MoMoney.Presentation/Presenters/Updates/CheckForUpdatesPresenter.cs
@@ -1,3 +1,4 @@
+using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Utility.Core;
 using MoMoney.Domain.Core;
 using MoMoney.Presentation.Core;
@@ -5,7 +6,6 @@ using MoMoney.Presentation.Model.updates;
 using MoMoney.Presentation.Presenters.Commands;
 using MoMoney.Presentation.Views.updates;
 using MoMoney.Service.Infrastructure.Updating;
-using MoMoney.Tasks.infrastructure.core;
 using MoMoney.Tasks.infrastructure.updating;
 
 namespace MoMoney.Presentation.Presenters.updates
trunk/product/MoMoney.Presentation/Presenters/Updates/CheckForUpdatesPresenterSpecs.cs
@@ -1,10 +1,10 @@
 using developwithpassion.bdd.contexts;
+using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Testing;
 using MoMoney.Presentation.Model.updates;
 using MoMoney.Presentation.Presenters.Commands;
 using MoMoney.Presentation.Views.updates;
 using MoMoney.Service.Infrastructure.Updating;
-using MoMoney.Tasks.infrastructure.core;
 using MoMoney.Tasks.infrastructure.updating;
 
 namespace MoMoney.Presentation.Presenters.updates
trunk/product/MoMoney.Presentation/Presenters/AddCompanyPresenter.cs
@@ -1,12 +1,13 @@
 using System.Collections.Generic;
 using System.Linq;
+using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Utility.Extensions;
 using MoMoney.Domain.accounting.billing;
 using MoMoney.DTO;
 using MoMoney.Presentation.Core;
 using MoMoney.Presentation.Views;
+using MoMoney.Service.Application;
 using MoMoney.Tasks.application;
-using MoMoney.Tasks.infrastructure.core;
 
 namespace MoMoney.Presentation.Presenters
 {
trunk/product/MoMoney.Presentation/Presenters/AddCompanyPresenterSpecs.cs
@@ -1,9 +1,10 @@
 using developwithpassion.bdd.contexts;
+using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Testing;
 using MoMoney.DTO;
 using MoMoney.Presentation.Views;
+using MoMoney.Service.Application;
 using MoMoney.Tasks.application;
-using MoMoney.Tasks.infrastructure.core;
 
 namespace MoMoney.Presentation.Presenters
 {
trunk/product/MoMoney.Presentation/Views/Billing/AddBillPaymentView.cs
@@ -2,8 +2,8 @@ using System;
 using System.Collections.Generic;
 using Gorilla.Commons.Utility.Extensions;
 using Gorilla.Commons.Windows.Forms;
+using Gorilla.Commons.Windows.Forms.Krypton;
 using MoMoney.Domain.accounting.billing;
-using MoMoney.Presentation.Databindings;
 using MoMoney.Presentation.Presenters.billing;
 using MoMoney.Presentation.Presenters.billing.dto;
 using MoMoney.Presentation.Views.core;
trunk/product/MoMoney.Presentation/Views/Income/AddNewIncomeView.cs
@@ -4,8 +4,8 @@ using System.Text;
 using System.Windows.Forms;
 using Gorilla.Commons.Utility.Extensions;
 using Gorilla.Commons.Windows.Forms;
+using Gorilla.Commons.Windows.Forms.Krypton;
 using MoMoney.Domain.accounting.billing;
-using MoMoney.Presentation.Databindings;
 using MoMoney.Presentation.Model.interaction;
 using MoMoney.Presentation.Presenters.income;
 using MoMoney.Presentation.Presenters.income.dto;
trunk/product/MoMoney.Service/Application/RegisterNewCompanyCommand.cs
@@ -2,7 +2,7 @@ using Gorilla.Commons.Utility.Core;
 using MoMoney.Domain.accounting.billing;
 using MoMoney.DTO;
 
-namespace MoMoney.Tasks.application
+namespace MoMoney.Service.Application
 {
     public interface IRegisterNewCompanyCommand : IParameterizedCommand<RegisterNewCompany>
     {
trunk/product/MoMoney.Service/Infrastructure/LogFileTasks.cs → trunk/product/MoMoney.Service/Infrastructure/Logging/LogFileTasks.cs
@@ -1,13 +1,12 @@
 using System.IO;
 using Gorilla.Commons.Infrastructure.Reflection;
 
-namespace MoMoney.Tasks.infrastructure
+namespace MoMoney.Service.Infrastructure.Logging
 {
     public interface ILogFileTasks
     {
         string get_the_contents_of_the_log_file();
         string get_the_path_to_the_log_file();
-        //void notify(ICallback<string> view);
     }
 
     public class LogFileTasks : ILogFileTasks
@@ -29,13 +28,5 @@ namespace MoMoney.Tasks.infrastructure
         {
             return Path.Combine(this.startup_directory(), @"logs\log.txt");
         }
-
-        //public void notify(ICallback<string> view)
-        //{
-        //    var watcher = new FileSystemWatcher(Path.Combine(this.startup_directory(), "logs"), "log.txt");
-        //    watcher.Changed += (sender, args) => view.run(get_the_contents_of_the_log_file());
-        //    watcher.EnableRaisingEvents = true;
-        //    watcher.Error += (sender, args) => this.log().error(args.GetException());
-        //}
     }
 }
\ No newline at end of file
trunk/product/MoMoney.Service/Infrastructure/Updating/DownloadTheLatestVersion.cs
@@ -1,6 +1,6 @@
+using Gorilla.Commons.Infrastructure;
 using Gorilla.Commons.Utility.Core;
 using MoMoney.Domain.Core;
-using MoMoney.Tasks.infrastructure.core;
 
 namespace MoMoney.Tasks.infrastructure.updating
 {
trunk/product/MoMoney.Service/MoMoney.Service.csproj
@@ -57,12 +57,7 @@
     <Compile Include="Application\IncomeTasks.cs" />
     <Compile Include="Application\RegisterNewCompanyCommand.cs" />
     <Compile Include="Application\SaveNewBillCommand.cs" />
-    <Compile Include="Infrastructure\Core\CommandFactory.cs" />
-    <Compile Include="Infrastructure\Core\CommandPump.cs" />
-    <Compile Include="Infrastructure\Core\ICallbackCommand.cs" />
-    <Compile Include="Infrastructure\Core\ProcessQueryCommand.cs" />
-    <Compile Include="Infrastructure\Core\RunQueryCommand.cs" />
-    <Compile Include="Infrastructure\LogFileTasks.cs" />
+    <Compile Include="Infrastructure\Logging\LogFileTasks.cs" />
     <Compile Include="Infrastructure\Updating\CancelUpdate.cs" />
     <Compile Include="Infrastructure\Updating\CancelUpdateSpecs.cs" />
     <Compile Include="Infrastructure\Updating\CurrentDeployment.cs" />
@@ -99,6 +94,7 @@
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Domain\" />
+    <Folder Include="Infrastructure\Core\" />
     <Folder Include="Properties\" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
trunk/product/MyMoney/boot/container/registration/proxy_configuration/NoConfiguration.cs
@@ -0,0 +1,12 @@
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
+using Gorilla.Commons.Utility.Core;
+
+namespace MoMoney.boot.container.registration.proxy_configuration
+{
+    internal class NoConfiguration<T> : IConfiguration<IProxyBuilder<T>>
+    {
+        public void configure(IProxyBuilder<T> item)
+        {
+        }
+    }
+}
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_data_access_components_into_the.cs
@@ -3,6 +3,7 @@ using Gorilla.Commons.Infrastructure.Container;
 using Gorilla.Commons.Infrastructure.Transactions;
 using Gorilla.Commons.Utility.Core;
 using Gorilla.Commons.Utility.Extensions;
+using MoMoney.boot.container.registration.proxy_configuration;
 using MoMoney.DataAccess;
 
 namespace MoMoney.boot.container.registration
@@ -18,10 +19,9 @@ namespace MoMoney.boot.container.registration
 
         public void run()
         {
-            //register.singleton<ISessionContext, SessionContext>();
             register.singleton<IDatabase, ObjectDatabase>();
-            register.singleton(() => Resolve.dependency_for<IDatabase>().downcast_to<IDatabaseConfiguration>());
-            register.singleton<ISession>(() => Resolve.dependency_for<ISessionProvider>().get_the_current_session());
+            register.singleton(() => Resolve.a<IDatabase>().downcast_to<IDatabaseConfiguration>());
+            register.proxy<ISession, NoConfiguration<ISession>>( () => Resolve.a<ISessionProvider>().get_the_current_session());
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_infrastructure_in_to_the.cs
@@ -22,13 +22,10 @@ namespace MoMoney.boot.container.registration
         {
             registry.singleton<IEventAggregator, EventAggregator>();
             registry.singleton<ITimer, IntervalTimer>();
-            //registry.singleton<IUnitOfWorkRegistry, UnitOfWorkRegistry>();
             registry.singleton<IProjectController, ProjectController>();
             registry.transient(typeof (IRegistry<>), typeof (DefaultRegistry<>));
-            //registry.transient(typeof (IUnitOfWorkRegistrationFactory<>), typeof (UnitOfWorkRegistrationFactory<>));
-
             registry.transient(typeof (ITrackerEntryMapper<>), typeof (TrackerEntryMapper<>));
-            registry.transient(typeof (IKey<>), typeof (TypedKey<>));
+            registry.transient(typeof(IKey<>), typeof(TypedKey<>));
             registry.transient(typeof (IComponentFactory<>), typeof (Factory<>));
             registry.singleton<IContext, Context>();
         }
trunk/product/MyMoney/boot/container/registration/wire_up_the_services_in_to_the.cs
@@ -4,6 +4,7 @@ using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
 using Gorilla.Commons.Utility.Core;
 using MoMoney.Domain.accounting.billing;
 using MoMoney.Domain.repositories;
+using MoMoney.Service.Application;
 using MoMoney.Tasks.application;
 
 namespace MoMoney.boot.container.registration
trunk/product/MyMoney/boot/global_error_handling.cs
@@ -20,7 +20,7 @@ namespace MoMoney.boot
         void handle(Exception e)
         {
             e.add_to_log();
-            Resolve.dependency_for<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
+            Resolve.a<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/start_the_application.cs
@@ -25,9 +25,9 @@ namespace MoMoney.boot
 
         public void run()
         {
-            processor.run();
             command.run();
             processor.add(() => thread.Dispose());
+            processor.run();
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/boot/WindowsFormsApplication.cs
@@ -55,12 +55,12 @@ namespace MoMoney.boot
         {
             try
             {
-                Application.Run(Resolve.dependency_for<Shell>());
+                Application.Run(Resolve.a<Shell>());
             }
             catch (Exception e)
             {
                 this.log().error(e);
-                Resolve.dependency_for<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
+                Resolve.a<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
             }
         }
     }
trunk/product/MyMoney/MyMoney.csproj
@@ -166,6 +166,7 @@
     </Compile>
     <Compile Include="boot\container\registration\auto_wire_components_in_to_the.cs" />
     <Compile Include="boot\container\registration\auto_wire_components_in_to_the_specs.cs" />
+    <Compile Include="boot\container\registration\proxy_configuration\NoConfiguration.cs" />
     <Compile Include="boot\container\registration\proxy_configuration\SynchronizedConfiguration.cs" />
     <Compile Include="boot\container\registration\wire_up_the_infrastructure_in_to_the.cs" />
     <Compile Include="boot\container\tear_down_the_container.cs" />