Commit 6d49261
Changed files (70)
trunk
product
Gorilla.Commons.Infrastructure
Gorilla.Commons.Infrastructure.ThirdParty
Castle
DynamicProxy
Interceptors
Windsor
Configuration
Log4Net
MoMoney.DataAccess
MoMoney.Infrastructure
MoMoney.Presentation
MoMoney.Service
MyMoney
boot
container
registration
proxy_configuration
trunk/product/Gorilla.Commons.Infrastructure/Proxies/RemotingProxyFactory.cs
@@ -5,12 +5,7 @@ using Gorilla.Commons.Utility.Extensions;
namespace Gorilla.Commons.Infrastructure.Proxies
{
- public interface IProxyFactory<T>
- {
- T CreateProxy();
- }
-
- public class RemotingProxyFactory<T> : RealProxy, IProxyFactory<T>
+ public class RemotingProxyFactory<T> : RealProxy
{
readonly T target;
readonly IEnumerable<IInterceptor> interceptors;
trunk/product/MoMoney.Infrastructure/Threading/Juval/Synchronizer.cs โ trunk/product/Gorilla.Commons.Infrastructure/Threading/Synchronizer.cs
@@ -5,7 +5,7 @@ using System.Diagnostics;
using System.Security.Permissions;
using System.Threading;
-namespace MoMoney.Infrastructure.Threading.Juval
+namespace Gorilla.Commons.Infrastructure.Threading
{
[SecurityPermission(SecurityAction.Demand, ControlThread = true)]
public class Synchronizer : ISynchronizeInvoke, IDisposable
trunk/product/MoMoney.Infrastructure/Threading/Juval/WorkItem.cs โ trunk/product/Gorilla.Commons.Infrastructure/Threading/WorkItem.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading;
-namespace MoMoney.Infrastructure.Threading.Juval
+namespace Gorilla.Commons.Infrastructure.Threading
{
[Serializable]
internal class WorkItem : IAsyncResult
trunk/product/Gorilla.Commons.Infrastructure/Gorilla.Commons.Infrastructure.csproj
@@ -112,12 +112,14 @@
<Compile Include="Threading\SynchronizationContextFactory.cs" />
<Compile Include="Threading\SynchronizedCommand.cs" />
<Compile Include="Threading\SynchronizedContext.cs" />
+ <Compile Include="Threading\Synchronizer.cs" />
<Compile Include="Threading\ThreadingExtensions.cs" />
<Compile Include="Threading\TimerFactory.cs" />
<Compile Include="Threading\TimerFactorySpecs.cs" />
<Compile Include="Threading\WorkerThread.cs">
<SubType>Component</SubType>
</Compile>
+ <Compile Include="Threading\WorkItem.cs" />
<Compile Include="Transactions\ChangeTracker.cs" />
<Compile Include="Transactions\ChangeTrackerFactory.cs" />
<Compile Include="Transactions\ChangeTrackerFactorySpecs.cs" />
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Autofac/AutofacDependencyRegistry.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Autofac;
using Gorilla.Commons.Infrastructure.Container;
-namespace MoMoney.Infrastructure.Container.Autofac
+namespace Gorilla.Commons.Infrastructure.Autofac
{
internal class AutofacDependencyRegistry : IDependencyRegistry
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Autofac/AutofacDependencyRegistryBuilder.cs
@@ -3,14 +3,14 @@ using Autofac;
using Autofac.Builder;
using Autofac.Modules;
using AutofacContrib.DynamicProxy2;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Infrastructure.proxies;
-namespace MoMoney.Infrastructure.Container.Autofac
+namespace Gorilla.Commons.Infrastructure.Autofac
{
- public class AutofacDependencyRegistryBuilder : IDependencyRegistration //, IBuilder<IContainer>
+ public class AutofacDependencyRegistryBuilder : IDependencyRegistration
{
readonly ContainerBuilder builder;
readonly Func<IContainer> container;
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Autofac/AutofacSpecs.cs
@@ -6,7 +6,7 @@ using Autofac.Modules;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.Container.Autofac
+namespace Gorilla.Commons.Infrastructure.Autofac
{
public class when_trying_to_register_a_single_item_in_the_autofac_container : concerns
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/IMethodCallTracker.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Castle.Core.Interceptor;
-namespace MoMoney.Infrastructure.proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public interface IMethodCallTracker<TypeToProxy> : IInterceptor
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/MethodCallTracker.cs
@@ -2,7 +2,7 @@ using System.Collections.Generic;
using Castle.Core.Interceptor;
using Gorilla.Commons.Utility.Extensions;
-namespace MoMoney.Infrastructure.proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public class MethodCallTracker<TypeToProxy> : IMethodCallTracker<TypeToProxy>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/MethodCallTrackerSpecs.cs
@@ -4,7 +4,7 @@ using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
[Concern(typeof (MethodCallTracker<IAnInterface>))]
public class behaves_like_method_call_tracker :
trunk/product/MoMoney.Infrastructure/Interceptors/RaiseEventInterceptor.cs โ trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/RaiseEventInterceptor.cs
@@ -1,7 +1,7 @@
using Castle.Core.Interceptor;
using Gorilla.Commons.Infrastructure.Eventing;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public interface IRaiseEventInterceptor<Event> : IInterceptor where Event : IEvent, new()
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/RunOnBackgroundThreadInterceptor.cs
@@ -2,7 +2,7 @@ using Castle.Core.Interceptor;
using Gorilla.Commons.Infrastructure.Threading;
using MoMoney.Utility.Core;
-namespace MoMoney.Infrastructure.proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public class RunOnBackgroundThreadInterceptor<CommandToExecute> : IInterceptor
where CommandToExecute : IDisposableCommand
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/RunOnBackgrounThreadInterceptorSpecs.cs
@@ -4,7 +4,7 @@ using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Testing;
using MoMoney.Utility.Core;
-namespace MoMoney.Infrastructure.proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
[Concern(typeof (RunOnBackgroundThreadInterceptor<>))]
public class behaves_like_background_thread_interceptor :
trunk/product/MoMoney.Infrastructure/Interceptors/RunOnUIThread.cs โ trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/RunOnUIThread.cs
@@ -1,9 +1,8 @@
using Castle.Core.Interceptor;
using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.interceptors;
-namespace MoMoney.Infrastructure.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public class RunOnUIThread : IInterceptor
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/SelectiveInterceptor.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Castle.Core.Interceptor;
-namespace Ec.AuditTool.Infrastructure.Proxies.Interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public class SelectiveInterceptor : IInterceptor
{
trunk/product/MoMoney.Infrastructure/Interceptors/SynchronizedInterceptor.cs โ trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/SynchronizedInterceptor.cs
@@ -3,7 +3,7 @@ using System.ComponentModel;
using Castle.Core.Interceptor;
using Gorilla.Commons.Utility.Extensions;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
{
public interface ISynchronizedInterceptor : IInterceptor
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Interceptors/UnitOfWorkInterceptor.cs
@@ -0,0 +1,35 @@
+using Castle.Core.Interceptor;
+using Gorilla.Commons.Infrastructure.Eventing;
+using Gorilla.Commons.Infrastructure.Logging;
+using Gorilla.Commons.Infrastructure.Transactions;
+using Gorilla.Commons.Utility.Core;
+
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors
+{
+ public interface IUnitOfWorkInterceptor : IInterceptor
+ {
+ }
+
+ public class UnitOfWorkInterceptor : IUnitOfWorkInterceptor
+ {
+ readonly IEventAggregator broker;
+ readonly IUnitOfWorkFactory factory;
+
+ public UnitOfWorkInterceptor(IEventAggregator broker, IUnitOfWorkFactory factory)
+ {
+ this.broker = broker;
+ this.factory = factory;
+ }
+
+ public void Intercept(IInvocation invocation)
+ {
+ using (var unit_of_work = factory.create())
+ {
+ this.log().debug("intercepting: {0}", invocation);
+ invocation.Proceed();
+ broker.publish<ICallback<IUnitOfWork>>(x => x.run(unit_of_work));
+ unit_of_work.commit();
+ }
+ }
+ }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IConstraintSelector.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IConstraintSelector<TypeToPutConstraintOn>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IInterceptorConstraint.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
-using MoMoney.Infrastructure.proxies.Interceptors;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IInterceptorConstraint<TypeToPutConstraintOn> : IConstraintSelector<TypeToPutConstraintOn>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IInterceptorConstraintFactory.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IInterceptorConstraintFactory
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IMethodCallTrackerFactory.cs
@@ -1,7 +1,7 @@
using Castle.DynamicProxy;
-using MoMoney.Infrastructure.proxies.Interceptors;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IMethodCallTrackerFactory
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/InterceptorConstraintFactorySpecs.cs
@@ -1,7 +1,7 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
[Concern(typeof (InterceptorConstraintFactory))]
public class behaves_like_constraint_factory :
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/InterceptorConstraintSpecs.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using developwithpassion.bdd.contexts;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
using Gorilla.Commons.Testing;
-using MoMoney.Infrastructure.proxies.Interceptors;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
[Concern(typeof (InterceptorConstraint<string>))]
public class behaves_like_constraint : concerns_for<IInterceptorConstraint<string>, InterceptorConstraint<string>>
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IProxyBuilder.cs
@@ -1,7 +1,7 @@
using System;
using Castle.Core.Interceptor;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IProxyBuilder<TypeToProxy>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/IProxyFactory.cs
@@ -1,7 +1,7 @@
using System;
using Castle.Core.Interceptor;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public interface IProxyFactory
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/LazyLoadedInterceptor.cs
@@ -1,7 +1,7 @@
using System;
using Castle.Core.Interceptor;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
internal class LazyLoadedInterceptor<T> : IInterceptor
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/ProxyBuilder.cs
@@ -2,9 +2,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Castle.Core.Interceptor;
-using Ec.AuditTool.Infrastructure.Proxies.Interceptors;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public class ProxyBuilder<TypeToProxy> : IProxyBuilder<TypeToProxy>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/ProxyBuilderSpecs.cs
@@ -6,7 +6,7 @@ using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
[Concern(typeof (ProxyBuilder<IAnInterface>))]
public class behaves_like_proxy_builder : concerns_for<IProxyBuilder<IAnInterface>, ProxyBuilder<IAnInterface>>
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/ProxyFactory.cs
@@ -3,9 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using Castle.Core.Interceptor;
using Castle.DynamicProxy;
-using MoMoney.Infrastructure.interceptors;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
public class ProxyFactory : IProxyFactory
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/ProxyFactorySpecs.cs
@@ -5,7 +5,7 @@ using developwithpassion.bdd.contexts;
using developwithpassion.bdd.mbunit;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.proxies
+namespace Gorilla.Commons.Infrastructure.Castle.DynamicProxy
{
[Concern(typeof(ProxyFactory))]
public abstract class behaves_like_proxy_factory : concerns_for<IProxyFactory, ProxyFactory>
@@ -91,7 +91,6 @@ namespace MoMoney.Infrastructure.proxies
}
}
-
public class TestInterceptor : IInterceptor
{
public bool recieved_call { get; set; }
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/ApplyLoggingInterceptor.cs
@@ -1,9 +1,8 @@
using Castle.Core;
using Castle.MicroKernel.Registration;
using Gorilla.Commons.Infrastructure.Logging;
-using MoMoney.Infrastructure.interceptors;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public class ApplyLoggingInterceptor : IRegistrationConfiguration
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/ComponentRegistrationConfiguration.cs
@@ -2,7 +2,7 @@ using Castle.MicroKernel.Registration;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public interface IRegistrationConfiguration : IConfiguration<ComponentRegistration>
{
@@ -12,9 +12,8 @@ namespace MoMoney.Infrastructure.Container.Windsor.configuration
{
public void configure(ComponentRegistration registration)
{
- new RegisterComponentContract()
- .then(new ConfigureComponentLifestyle())
- .then(new ApplyLoggingInterceptor())
+ ConfigurationExtensions.then(new RegisterComponentContract()
+ .then(new ConfigureComponentLifestyle()), new ApplyLoggingInterceptor())
//.then(new LogComponent())
.configure(registration);
}
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/ConfigureComponentLifestyle.cs
@@ -1,7 +1,7 @@
using Castle.Core;
using Castle.MicroKernel.Registration;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public class ConfigureComponentLifestyle : IRegistrationConfiguration
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/IComponentExclusionSpecification.cs
@@ -1,7 +1,7 @@
using System;
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public interface IComponentExclusionSpecification : ISpecification<Type>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/LogComponent.cs
@@ -1,6 +1,6 @@
using Castle.MicroKernel.Registration;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public class LogComponent : IRegistrationConfiguration
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/LoggingInterceptor.cs
@@ -2,7 +2,7 @@ using System.Diagnostics;
using Castle.Core.Interceptor;
using Gorilla.Commons.Infrastructure.Logging;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public interface ILoggingInterceptor : IInterceptor
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/Configuration/RegisterComponentContract.cs
@@ -1,6 +1,6 @@
using Castle.MicroKernel.Registration;
-namespace MoMoney.Infrastructure.Container.Windsor.configuration
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration
{
public class RegisterComponentContract : IRegistrationConfiguration
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/WindsorContainerFactory.cs
@@ -1,9 +1,7 @@
-using System;
-using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Infrastructure.Container.Windsor
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor
{
public interface IWindsorContainerFactory : IFactory<IWindsorContainer>
{
@@ -16,23 +14,4 @@ namespace MoMoney.Infrastructure.Container.Windsor
return new WindsorContainer();
}
}
-
- public static class e
- {
- public static BasedOnDescriptor LastInterface(this ServiceDescriptor descriptor)
- {
- return descriptor.Select(delegate(Type type, Type baseType)
- {
- Type first = null;
- var interfaces = type.GetInterfaces();
-
- if (interfaces.Length > 0)
- {
- first = interfaces[0];
- }
-
- return (first != null) ? new[] {first} : null;
- });
- }
- }
}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/WindsorDependencyRegistry.cs
@@ -2,12 +2,12 @@ using System;
using System.Collections.Generic;
using Castle.Core;
using Castle.Windsor;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Infrastructure.proxies;
-namespace MoMoney.Infrastructure.Container.Windsor
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor
{
internal class WindsorDependencyRegistry : IDependencyRegistration, IDependencyRegistry
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/WindsorDependencyRegistrySpecs.cs
@@ -4,7 +4,7 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.Container.Windsor
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor
{
[Concern(typeof (WindsorDependencyRegistry))]
internal class behaves_like_windsor_dependency_registry :
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/Windsor/WindsorExtensions.cs
@@ -0,0 +1,20 @@
+using System;
+using Castle.MicroKernel.Registration;
+
+namespace Gorilla.Commons.Infrastructure.Castle.Windsor
+{
+ public static class WindsorExtensions
+ {
+ public static BasedOnDescriptor LastInterface(this ServiceDescriptor descriptor)
+ {
+ return descriptor.Select((type, base_type) =>
+ {
+ Type first = null;
+ var interfaces = type.GetInterfaces();
+ if (interfaces.Length > 0) first = interfaces[0];
+
+ return (first != null) ? new[] {first} : null;
+ });
+ }
+ }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Log4Net/Log4NetLogFactory.cs
@@ -5,7 +5,7 @@ using Gorilla.Commons.Infrastructure.Reflection;
using log4net;
using log4net.Config;
-namespace MoMoney.Infrastructure.Logging.Log4Net
+namespace Gorilla.Commons.Infrastructure.Log4Net
{
public class Log4NetLogFactory : ILogFactory
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Log4Net/Log4NetLogger.cs
@@ -2,7 +2,7 @@ using System;
using Gorilla.Commons.Infrastructure.Logging;
using log4net;
-namespace MoMoney.Infrastructure.Logging.Log4Net
+namespace Gorilla.Commons.Infrastructure.Log4Net
{
public class Log4NetLogger : ILogger
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Gorilla.Commons.Infrastructure.ThirdParty.csproj
@@ -92,6 +92,11 @@
<Compile Include="Autofac\AutofacDependencyRegistry.cs" />
<Compile Include="Autofac\AutofacDependencyRegistryBuilder.cs" />
<Compile Include="Autofac\AutofacSpecs.cs" />
+ <Compile Include="Castle\DynamicProxy\Interceptors\RaiseEventInterceptor.cs" />
+ <Compile Include="Castle\DynamicProxy\Interceptors\RunOnUIThread.cs" />
+ <Compile Include="Castle\DynamicProxy\Interceptors\SynchronizedInterceptor.cs" />
+ <Compile Include="Castle\DynamicProxy\Interceptors\UnitOfWorkInterceptor.cs" />
+ <Compile Include="Castle\Windsor\WindsorExtensions.cs" />
<Compile Include="IDependencyRegistration.cs" />
<Compile Include="Log4Net\Log4NetLogFactory.cs" />
<Compile Include="Log4Net\Log4NetLogger.cs" />
@@ -109,9 +114,9 @@
<Compile Include="Castle\DynamicProxy\Interceptors\SelectiveInterceptor.cs" />
<Compile Include="Castle\DynamicProxy\IProxyBuilder.cs" />
<Compile Include="Castle\DynamicProxy\IProxyFactory.cs" />
- <Compile Include="Castle\DynamicProxy\Lazy.cs" />
+ <Compile Include="Lazy.cs" />
<Compile Include="Castle\DynamicProxy\LazyLoadedInterceptor.cs" />
- <Compile Include="Castle\DynamicProxy\LazySpecs.cs" />
+ <Compile Include="LazySpecs.cs" />
<Compile Include="Castle\DynamicProxy\ProxyBuilder.cs" />
<Compile Include="Castle\DynamicProxy\ProxyBuilderSpecs.cs" />
<Compile Include="Castle\DynamicProxy\ProxyFactory.cs" />
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/IDependencyRegistration.cs
@@ -1,9 +1,9 @@
using System;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.proxies;
-namespace MoMoney.Infrastructure.Container
+namespace Gorilla.Commons.Infrastructure
{
public interface IDependencyRegistration : IBuilder<IDependencyRegistry>
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/Lazy.cs โ trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Lazy.cs
@@ -1,10 +1,11 @@
using System;
using Castle.Core.Interceptor;
using Castle.DynamicProxy;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Extensions;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure
{
public static class Lazy
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Castle/DynamicProxy/LazySpecs.cs โ trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/LazySpecs.cs
@@ -2,7 +2,7 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Testing;
-namespace MoMoney.Infrastructure.interceptors
+namespace Gorilla.Commons.Infrastructure
{
[Concern(typeof (Lazy))]
public abstract class behaves_like_a_lazy_loaded_object : concerns
@@ -20,7 +20,7 @@ namespace MoMoney.Infrastructure.interceptors
public class when_calling_a_method_with_no_arguments_on_a_lazy_loaded_proxy : behaves_like_a_lazy_loaded_object
{
- it should_forward_the_original_call_to_the_target = () => target.was_told_to(t => t.OneMethod());
+ it should_forward_the_original_call_to_the_target = () => target.was_told_to<ITargetObject>(t => t.OneMethod());
context c = () =>
{
trunk/product/MoMoney.DataAccess/MoMoney.DataAccess.csproj
@@ -98,10 +98,6 @@
<Project>{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}</Project>
<Name>MoMoney.Domain</Name>
</ProjectReference>
- <ProjectReference Include="..\MoMoney.Infrastructure\MoMoney.Infrastructure.csproj">
- <Project>{4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}</Project>
- <Name>MoMoney.Infrastructure</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
trunk/product/MoMoney.Infrastructure/MoMoney.Infrastructure.csproj
@@ -88,14 +88,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
- <ItemGroup>
- <Compile Include="Interceptors\RaiseEventInterceptor.cs" />
- <Compile Include="Interceptors\SynchronizedInterceptor.cs" />
- <Compile Include="Threading\Juval\Synchronizer.cs" />
- <Compile Include="Threading\Juval\WorkItem.cs" />
- <Compile Include="Interceptors\RunOnUIThread.cs" />
- <Compile Include="Interceptors\UnitOfWorkInterceptor.cs" />
- </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Gorilla.Commons.Infrastructure.ThirdParty\Gorilla.Commons.Infrastructure.ThirdParty.csproj">
<Project>{04DC09B4-5DF9-44A6-8DD1-05941F0D0228}</Project>
trunk/product/MoMoney.Presentation/MoMoney.Presentation.csproj
@@ -483,10 +483,6 @@
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
<Name>MoMoney.DTO</Name>
</ProjectReference>
- <ProjectReference Include="..\MoMoney.Infrastructure\MoMoney.Infrastructure.csproj">
- <Project>{4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}</Project>
- <Name>MoMoney.Infrastructure</Name>
- </ProjectReference>
<ProjectReference Include="..\MoMoney.Service\MoMoney.Service.csproj">
<Project>{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}</Project>
<Name>MoMoney.Service</Name>
trunk/product/MoMoney.Service/MoMoney.Service.csproj
@@ -96,10 +96,6 @@
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
<Name>MoMoney.DTO</Name>
</ProjectReference>
- <ProjectReference Include="..\MoMoney.Infrastructure\MoMoney.Infrastructure.csproj">
- <Project>{4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}</Project>
- <Name>MoMoney.Infrastructure</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Domain\" />
trunk/product/MyMoney/boot/container/registration/proxy_configuration/SynchronizedConfiguration.cs
@@ -1,6 +1,6 @@
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Interceptors;
-using MoMoney.Infrastructure.proxies;
namespace MoMoney.boot.container.registration.proxy_configuration
{
trunk/product/MyMoney/boot/container/registration/auto_wire_components_in_to_the.cs
@@ -1,10 +1,10 @@
using System;
using System.Reflection;
+using Gorilla.Commons.Infrastructure;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Infrastructure.Reflection;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.Container.Windsor.configuration;
namespace MoMoney.boot.container.registration
{
trunk/product/MyMoney/boot/container/registration/auto_wire_components_in_to_the_specs.cs
@@ -1,10 +1,10 @@
using System;
using developwithpassion.bdd.contexts;
+using Gorilla.Commons.Infrastructure;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Infrastructure.Reflection;
using Gorilla.Commons.Testing;
using MbUnit.Framework;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.Container.Windsor.configuration;
namespace MoMoney.boot.container.registration
{
trunk/product/MyMoney/boot/container/registration/run_mass_component_registration_in_to_the.cs
@@ -1,8 +1,8 @@
using Castle.MicroKernel.Registration;
using Castle.Windsor;
+using Gorilla.Commons.Infrastructure.Castle.Windsor;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container.Windsor;
-using MoMoney.Infrastructure.Container.Windsor.configuration;
namespace MoMoney.boot.container.registration
{
trunk/product/MyMoney/boot/container/registration/SynchronizedConfiguration.cs
@@ -1,14 +0,0 @@
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Interceptors;
-using MoMoney.Infrastructure.proxies;
-
-namespace MoMoney.boot.container.registration
-{
- internal class SynchronizedConfiguration<T> : IConfiguration<IProxyBuilder<T>>
- {
- public void configure(IProxyBuilder<T> item)
- {
- item.add_interceptor<RunOnUIThread>().intercept_all();
- }
- }
-}
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_data_access_components_into_the.cs
@@ -1,9 +1,9 @@
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.DataAccess;
-using MoMoney.Infrastructure.Container;
namespace MoMoney.boot.container.registration
{
trunk/product/MyMoney/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -2,12 +2,12 @@ using System.ComponentModel;
using System.Deployment.Application;
using System.Threading;
using System.Windows.Forms;
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Container;
+using Gorilla.Commons.Infrastructure.Log4Net;
using Gorilla.Commons.Infrastructure.Logging;
using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.Logging.Log4Net;
using MoMoney.Tasks.infrastructure.updating;
namespace MoMoney.boot.container.registration
trunk/product/MyMoney/boot/container/registration/wire_up_the_infrastructure_in_to_the.cs
@@ -1,9 +1,9 @@
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Eventing;
using Gorilla.Commons.Infrastructure.Registries;
using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Infrastructure.Transactions;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container;
//using MoMoney.Infrastructure.transactions;
using MoMoney.Presentation.Model.Projects;
trunk/product/MyMoney/boot/container/registration/wire_up_the_mappers_in_to_the.cs
@@ -1,5 +1,5 @@
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container;
namespace MoMoney.boot.container.registration
{
trunk/product/MyMoney/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -1,10 +1,10 @@
using System;
using System.Reflection;
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Reflection;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.interceptors;
+using MoMoney.boot.container.registration.proxy_configuration;
using MoMoney.Modules.Core;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu.File;
trunk/product/MyMoney/boot/container/registration/wire_up_the_reports_in_to_the.cs
@@ -1,5 +1,5 @@
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container;
using MoMoney.Presentation.Views.billing;
using MoMoney.Presentation.Views.reporting;
trunk/product/MyMoney/boot/container/registration/wire_up_the_services_in_to_the.cs
@@ -1,10 +1,9 @@
+using Gorilla.Commons.Infrastructure;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
+using Gorilla.Commons.Infrastructure.Castle.DynamicProxy.Interceptors;
using Gorilla.Commons.Utility.Core;
using MoMoney.Domain.accounting.billing;
using MoMoney.Domain.repositories;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.interceptors;
-using MoMoney.Infrastructure.Interceptors;
-using MoMoney.Infrastructure.proxies;
using MoMoney.Tasks.application;
namespace MoMoney.boot.container.registration
trunk/product/MyMoney/boot/container/registration/wire_up_the_views_in_to_the.cs
@@ -1,7 +1,7 @@
using System.ComponentModel;
using System.Windows.Forms;
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.Container;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Views.billing;
using MoMoney.Presentation.Views.dialogs;
trunk/product/MyMoney/boot/container/ComponentExclusionSpecification.cs
@@ -1,4 +1,5 @@
using System;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Utility.Extensions;
namespace MoMoney.Infrastructure.Container.Windsor.configuration
trunk/product/MyMoney/boot/container/ComponentExclusionSpecificationSpecs.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
using developwithpassion.bdd.contexts;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Testing;
using MoMoney.Domain.Core;
trunk/product/MyMoney/boot/container/wire_up_the_container.cs
@@ -1,9 +1,10 @@
+using Gorilla.Commons.Infrastructure;
+using Gorilla.Commons.Infrastructure.Autofac;
+using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Utility.Core;
using Gorilla.Commons.Utility.Extensions;
using MoMoney.boot.container.registration;
-using MoMoney.Infrastructure.Container;
-using MoMoney.Infrastructure.Container.Autofac;
using MoMoney.Infrastructure.Container.Windsor.configuration;
namespace MoMoney.boot.container
trunk/product/MyMoney/boot/start_the_application.cs
@@ -1,6 +1,6 @@
+using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Threading;
using Gorilla.Commons.Utility.Core;
-using MoMoney.Infrastructure.interceptors;
using MoMoney.Modules.Core;
namespace MoMoney.boot
trunk/product/MyMoney/MyMoney.csproj
@@ -167,7 +167,6 @@
<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\SynchronizedConfiguration.cs" />
- <Compile Include="boot\container\registration\SynchronizedConfiguration.cs" />
<Compile Include="boot\container\registration\wire_up_the_infrastructure_in_to_the.cs" />
<Compile Include="boot\container\tear_down_the_container.cs" />
<Compile Include="boot\container\registration\wire_up_the_data_access_components_into_the.cs" />
@@ -244,10 +243,6 @@
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
<Name>MoMoney.DTO</Name>
</ProjectReference>
- <ProjectReference Include="..\MoMoney.Infrastructure\MoMoney.Infrastructure.csproj">
- <Project>{4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}</Project>
- <Name>MoMoney.Infrastructure</Name>
- </ProjectReference>
<ProjectReference Include="..\MoMoney.Presentation\MoMoney.Presentation.csproj">
<Project>{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}</Project>
<Name>MoMoney.Presentation</Name>
@@ -257,44 +252,6 @@
<Name>MoMoney.Service</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Folder Include="Presentation\Core\" />
- <Folder Include="Presentation\Databindings\" />
- <Folder Include="Presentation\Model\file_system\" />
- <Folder Include="Presentation\Model\interaction\" />
- <Folder Include="Presentation\Model\keyboard\" />
- <Folder Include="Presentation\Model\Menu\File\Commands\" />
- <Folder Include="Presentation\Model\Menu\Help\commands\" />
- <Folder Include="Presentation\Model\Menu\window\" />
- <Folder Include="Presentation\Model\messages\" />
- <Folder Include="Presentation\Model\Navigation\branches\" />
- <Folder Include="Presentation\Model\Projects\" />
- <Folder Include="Presentation\Model\reporting\" />
- <Folder Include="Presentation\Model\updates\" />
- <Folder Include="Presentation\Presenters\billing\dto\" />
- <Folder Include="Presentation\Presenters\Commands\" />
- <Folder Include="Presentation\Presenters\excel\formatting\" />
- <Folder Include="Presentation\Presenters\income\dto\" />
- <Folder Include="Presentation\Presenters\Menu\Help\" />
- <Folder Include="Presentation\Presenters\Navigation\" />
- <Folder Include="Presentation\Presenters\reporting\" />
- <Folder Include="Presentation\Presenters\Shell\" />
- <Folder Include="Presentation\Presenters\Startup\" />
- <Folder Include="Presentation\Presenters\updates\" />
- <Folder Include="Presentation\Resources\" />
- <Folder Include="Presentation\Views\billing\" />
- <Folder Include="Presentation\Views\core\" />
- <Folder Include="Presentation\Views\dialogs\" />
- <Folder Include="Presentation\Views\helpers\" />
- <Folder Include="Presentation\Views\income\" />
- <Folder Include="Presentation\Views\Menu\Help\" />
- <Folder Include="Presentation\Views\Menu\Mappers\" />
- <Folder Include="Presentation\Views\Navigation\" />
- <Folder Include="Presentation\Views\reporting\" />
- <Folder Include="Presentation\Views\Shell\" />
- <Folder Include="Presentation\Views\Startup\" />
- <Folder Include="Presentation\Views\updates\" />
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
trunk/solution.sln
@@ -15,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoMoney.Service", "product\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoMoney.DataAccess", "product\MoMoney.DataAccess\MoMoney.DataAccess.csproj", "{580E68A8-EDEE-4350-8BBE-A053645B0F83}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoMoney.Infrastructure", "product\MoMoney.Infrastructure\MoMoney.Infrastructure.csproj", "{4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoMoney.DTO", "product\MoMoney.DTO\MoMoney.DTO.csproj", "{ACF52FAB-435B-48C9-A383-C787CB2D8000}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoMoney.Presentation", "product\MoMoney.Presentation\MoMoney.Presentation.csproj", "{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}"
@@ -59,10 +57,6 @@ Global
{580E68A8-EDEE-4350-8BBE-A053645B0F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{580E68A8-EDEE-4350-8BBE-A053645B0F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{580E68A8-EDEE-4350-8BBE-A053645B0F83}.Release|Any CPU.Build.0 = Release|Any CPU
- {4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4E6E2528-3779-4CFC-BC43-F42EE13ED2D0}.Release|Any CPU.Build.0 = Release|Any CPU
{ACF52FAB-435B-48C9-A383-C787CB2D8000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACF52FAB-435B-48C9-A383-C787CB2D8000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACF52FAB-435B-48C9-A383-C787CB2D8000}.Release|Any CPU.ActiveCfg = Release|Any CPU