Commit 2f3dd3f
Changed files (359)
build
product
Boot
boot
container
registration
mapping
proxy_configuration
Modules
Core
Properties
DataAccess
Db40
Transactions
Domain
DTO
Presentation
Core
Model
Menu
File
Window
Navigation
Projects
Reporting
Presenters
Views
Winforms
Databinding
Helpers
Krypton
Resources
Views
Service
Application
Infrastructure
Security
Threading
Transactions
Updating
Service.Contracts
Application
Infrastructure
build/lib/app/gorilla/gorilla.commons.infrastructure.dll
Binary file
build/lib/app/gorilla/gorilla.commons.infrastructure.thirdparty.dll
Binary file
build/lib/app/gorilla/gorilla.commons.infrastructure.thirdparty.log4net.dll
Binary file
build/lib/app/gorilla/gorilla.commons.utility.dll
Binary file
product/Boot/boot/container/registration/mapping/IMap.cs
@@ -1,10 +1,10 @@
using System;
using System.Linq.Expressions;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.mapping
{
- public interface IMap<Input, Output> : IMapper<Input, Output>
+ public interface IMap<Input, Output> : Mapper<Input, Output>
{
void add(IMappingStep<Input, Output> step);
product/Boot/boot/container/registration/mapping/ImmutablePropertyException.cs
@@ -1,6 +1,6 @@
using System;
using System.Reflection;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.mapping
{
@@ -9,9 +9,6 @@ namespace MoMoney.boot.container.registration.mapping
public const string exception_message_format = "The property [{0}] on the target type [{1}] is immutable";
public ImmutablePropertyException(Type target, PropertyInfo property)
- : base(exception_message_format.formatted_using(property.Name, target.Name))
-
- {
- }
+ : base(exception_message_format.formatted_using(property.Name, target.Name)) {}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/mapping/Map.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.mapping
{
@@ -11,15 +11,11 @@ namespace MoMoney.boot.container.registration.mapping
readonly IList<IMappingStep<Input, Output>> mapping_steps;
readonly IMappingStepFactory mapping_step_factory;
- public Map() : this(new MappingStepFactory())
- {
- }
+ public Map() : this(new MappingStepFactory()) {}
public Map(IMappingStepFactory mapping_step_factory)
: this(
- new MissingInitializationStep<Output>(), new List<IMappingStep<Input, Output>>(), mapping_step_factory)
- {
- }
+ new MissingInitializationStep<Output>(), new List<IMappingStep<Input, Output>>(), mapping_step_factory) {}
public Map(IMapInitializationStep<Output> map_initialization_step,
IList<IMappingStep<Input, Output>> mapping_steps, IMappingStepFactory mapping_step_factory)
product/Boot/boot/container/registration/mapping/Mappers.cs
@@ -1,4 +1,4 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.DTO;
@@ -6,7 +6,7 @@ namespace MoMoney.boot.container.registration.mapping
{
public class Mappers
{
- static public IMapper<IBill, BillInformationDTO> bill_mapper =
+ static public Mapper<IBill, BillInformationDTO> bill_mapper =
new Map<IBill, BillInformationDTO>()
.initialize_mapping_using(() => new BillInformationDTO())
.map(x => x.company_to_pay.name, y => y.company_name)
product/Boot/boot/container/registration/mapping/PropertyResolutionException.cs
@@ -1,5 +1,5 @@
using System;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.mapping
{
@@ -11,9 +11,6 @@ namespace MoMoney.boot.container.registration.mapping
string property_that_could_not_be_found)
: base(
exception_message_format.formatted_using(property_that_could_not_be_found,
- type_that_did_not_have_the_property.Name))
-
- {
- }
+ type_that_did_not_have_the_property.Name)) {}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/mapping/PropertyResolver.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.mapping
{
product/Boot/boot/container/registration/proxy_configuration/InterceptingFilter.cs
@@ -1,13 +1,13 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
public class InterceptingFilter : IInterceptor
{
- readonly ISpecification<IInvocation> condition;
+ readonly Specification<IInvocation> condition;
- public InterceptingFilter(ISpecification<IInvocation> condition)
+ public InterceptingFilter(Specification<IInvocation> condition)
{
this.condition = condition;
}
product/Boot/boot/container/registration/proxy_configuration/InterceptingFilterFactory.cs
@@ -1,16 +1,16 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
public interface IInterceptingFilterFactory
{
- IInterceptor create_for(ISpecification<IInvocation> specification);
+ IInterceptor create_for(Specification<IInvocation> specification);
}
public class InterceptingFilterFactory : IInterceptingFilterFactory
{
- public IInterceptor create_for(ISpecification<IInvocation> specification)
+ public IInterceptor create_for(Specification<IInvocation> specification)
{
return new InterceptingFilter(specification);
}
product/Boot/boot/container/registration/proxy_configuration/InterceptingFilterFactorySpecs.cs
@@ -1,7 +1,7 @@
using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
@@ -10,17 +10,23 @@ namespace MoMoney.boot.container.registration.proxy_configuration
public class when_creating_an_intercepting_filter :
concerns_for<IInterceptingFilterFactory, InterceptingFilterFactory>
{
- context c = () => { condition = an<ISpecification<IInvocation>>(); };
+ context c = () =>
+ {
+ condition = an<Specification<IInvocation>>();
+ };
- because b = () => { result = sut.create_for(condition); };
+ because b = () =>
+ {
+ result = sut.create_for(condition);
+ };
it should_return_a_filter = () =>
- {
- result.should_not_be_null();
- result.should_be_an_instance_of<InterceptingFilter>();
- };
+ {
+ result.should_not_be_null();
+ result.should_be_an_instance_of<InterceptingFilter>();
+ };
- static ISpecification<IInvocation> condition;
+ static Specification<IInvocation> condition;
static IInterceptor result;
}
}
product/Boot/boot/container/registration/proxy_configuration/InterceptingFilterSpecs.cs
@@ -1,7 +1,7 @@
using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
@@ -9,18 +9,21 @@ namespace MoMoney.boot.container.registration.proxy_configuration
{
public class when_intercepting_a_call : concerns_for<IInterceptor, InterceptingFilter>
{
- context c = () => { condition = the_dependency<ISpecification<IInvocation>>(); };
+ context c = () =>
+ {
+ condition = the_dependency<Specification<IInvocation>>();
+ };
- static protected ISpecification<IInvocation> condition;
+ static protected Specification<IInvocation> condition;
}
public class when_a_condition_is_not_met : when_intercepting_a_call
{
context c = () =>
- {
- invocation = an<IInvocation>();
- when_the(condition).is_told_to(x => x.is_satisfied_by(invocation)).it_will_return(false);
- };
+ {
+ invocation = an<IInvocation>();
+ when_the(condition).is_told_to(x => x.is_satisfied_by(invocation)).it_will_return(false);
+ };
because b = () => sut.Intercept(invocation);
@@ -32,10 +35,10 @@ namespace MoMoney.boot.container.registration.proxy_configuration
public class when_a_condition_is_met : when_intercepting_a_call
{
context c = () =>
- {
- invocation = an<IInvocation>();
- when_the(condition).is_told_to(x => x.is_satisfied_by(invocation)).it_will_return(true);
- };
+ {
+ invocation = an<IInvocation>();
+ when_the(condition).is_told_to(x => x.is_satisfied_by(invocation)).it_will_return(true);
+ };
because b = () => sut.Intercept(invocation);
product/Boot/boot/container/registration/proxy_configuration/NoConfiguration.cs
@@ -1,12 +1,10 @@
-using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- class NoConfiguration<T> : IConfiguration<IProxyBuilder<T>>
+ class NoConfiguration<T> : Configuration<ProxyBuilder<T>>
{
- public void configure(IProxyBuilder<T> item)
- {
- }
+ public void configure(ProxyBuilder<T> item) {}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/proxy_configuration/NotifyProgressInterceptor.cs
@@ -1,10 +1,12 @@
using Castle.Core.Interceptor;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- public interface INotifyProgressInterceptor : IInterceptor {}
+ public interface INotifyProgressInterceptor : IInterceptor
+ {
+ }
public class NotifyProgressInterceptor : INotifyProgressInterceptor
{
@@ -17,9 +19,9 @@ namespace MoMoney.boot.container.registration.proxy_configuration
public void Intercept(IInvocation invocation)
{
- broker.publish(new StartedRunningCommand(invocation.InvocationTarget));
+ broker.publish(new StartedRunningCommand(invocation.TargetType.Name));
invocation.Proceed();
- broker.publish(new FinishedRunningCommand(invocation.InvocationTarget));
+ broker.publish(new FinishedRunningCommand(invocation.TargetType.Name));
}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/proxy_configuration/SecuringProxy.cs
@@ -2,15 +2,15 @@ using System.Security.Principal;
using System.Threading;
using Castle.Core.Interceptor;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
public class SecuringProxy : IInterceptor
{
- readonly ISpecification<IPrincipal> filter;
+ readonly Specification<IPrincipal> filter;
- public SecuringProxy(ISpecification<IPrincipal> filter)
+ public SecuringProxy(Specification<IPrincipal> filter)
{
this.filter = filter;
}
product/Boot/boot/container/registration/proxy_configuration/SecuringProxySpecs.cs
@@ -3,32 +3,33 @@ using System.Threading;
using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- public class SecuringProxySpecs
- {
- }
+ public class SecuringProxySpecs {}
public class when_attempting_to_perform_an_action_that_requires_authentication :
concerns_for<SecuringProxy>
{
- context c = () => { filter = the_dependency<ISpecification<IPrincipal>>(); };
+ context c = () =>
+ {
+ filter = the_dependency<Specification<IPrincipal>>();
+ };
- static protected ISpecification<IPrincipal> filter;
+ static protected Specification<IPrincipal> filter;
}
public class when_logged_in_as_a_user_that_belongs_to_the_proper_role :
when_attempting_to_perform_an_action_that_requires_authentication
{
context c = () =>
- {
- invocation = an<IInvocation>();
- when_the(filter)
- .is_told_to(x => x.is_satisfied_by(Thread.CurrentPrincipal))
- .it_will_return(true);
- };
+ {
+ invocation = an<IInvocation>();
+ when_the(filter)
+ .is_told_to(x => x.is_satisfied_by(Thread.CurrentPrincipal))
+ .it_will_return(true);
+ };
because b = () => sut.Intercept(invocation);
@@ -41,12 +42,12 @@ namespace MoMoney.boot.container.registration.proxy_configuration
when_attempting_to_perform_an_action_that_requires_authentication
{
context c = () =>
- {
- invocation = an<IInvocation>();
- when_the(filter)
- .is_told_to(x => x.is_satisfied_by(Thread.CurrentPrincipal))
- .it_will_return(false);
- };
+ {
+ invocation = an<IInvocation>();
+ when_the(filter)
+ .is_told_to(x => x.is_satisfied_by(Thread.CurrentPrincipal))
+ .it_will_return(false);
+ };
because b = () => sut.Intercept(invocation);
product/Boot/boot/container/registration/proxy_configuration/ServiceLayerConfiguration.cs
@@ -1,12 +1,11 @@
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- class ServiceLayerConfiguration<T> : IConfiguration<IProxyBuilder<T>>
+ class ServiceLayerConfiguration<T> : Configuration<ProxyBuilder<T>>
{
- public void configure(IProxyBuilder<T> item)
+ public void configure(ProxyBuilder<T> item)
{
item.add_interceptor(Lazy.load<INotifyProgressInterceptor>()).intercept_all();
item.add_interceptor(Lazy.load<IUnitOfWorkInterceptor>()).intercept_all();
product/Boot/boot/container/registration/proxy_configuration/SynchronizedConfiguration.cs
@@ -1,12 +1,12 @@
-using Gorilla.Commons.Infrastructure.Castle.DynamicProxy;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Threading;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
+using momoney.service.infrastructure.threading;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- class SynchronizedConfiguration<T> : IConfiguration<IProxyBuilder<T>>
+ class SynchronizedConfiguration<T> : Configuration<ProxyBuilder<T>>
{
- public void configure(IProxyBuilder<T> item)
+ public void configure(ProxyBuilder<T> item)
{
item.add_interceptor<RunOnUIThread>().intercept_all();
}
product/Boot/boot/container/registration/proxy_configuration/UnitOfWorkInterceptor.cs
@@ -1,13 +1,12 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using momoney.service.contracts.infrastructure.transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.boot.container.registration.proxy_configuration
{
- public interface IUnitOfWorkInterceptor : IInterceptor
- {
- }
+ public interface IUnitOfWorkInterceptor : IInterceptor {}
public class UnitOfWorkInterceptor : IUnitOfWorkInterceptor
{
@@ -25,7 +24,7 @@ namespace MoMoney.boot.container.registration.proxy_configuration
using (var unit_of_work = factory.create())
{
invocation.Proceed();
- broker.publish<ICallback<IUnitOfWork>>(x => x.run(unit_of_work));
+ broker.publish<Callback<IUnitOfWork>>(x => x.run(unit_of_work));
unit_of_work.commit();
}
}
product/Boot/boot/container/registration/auto_wire_components_in_to_the.cs
@@ -1,24 +1,21 @@
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.Extensions;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Castle.Windsor.Configuration;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration
{
public class auto_wire_components_in_to_the : IStartupCommand
{
- readonly IDependencyRegistration registrar;
- readonly IComponentExclusionSpecification exclusion_policy;
+ readonly DependencyRegistration registrar;
+ readonly ComponentExclusionSpecification exclusion_policy;
- public auto_wire_components_in_to_the(IDependencyRegistration registrar)
- : this(registrar, new ComponentExclusionSpecification())
- {
- }
+ public auto_wire_components_in_to_the(DependencyRegistration registrar)
+ : this(registrar, new ComponentExclusionSpecificationImplementation()) {}
- public auto_wire_components_in_to_the(IDependencyRegistration registration,
- IComponentExclusionSpecification exclusion_policy)
+ public auto_wire_components_in_to_the(DependencyRegistration registration,
+ ComponentExclusionSpecification exclusion_policy)
{
registrar = registration;
this.exclusion_policy = exclusion_policy;
@@ -26,10 +23,10 @@ namespace MoMoney.boot.container.registration
public void run()
{
- run(new ApplicationAssembly(Assembly.GetExecutingAssembly()));
+ run(new ApplicationAssembly(System.Reflection.Assembly.GetExecutingAssembly()));
}
- public void run(IAssembly item)
+ public void run(Assembly item)
{
item
.all_types()
product/Boot/boot/container/registration/auto_wire_components_in_to_the_specs.cs
@@ -1,8 +1,8 @@
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.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Castle.Windsor.Configuration;
using Gorilla.Commons.Testing;
using MbUnit.Framework;
@@ -13,18 +13,18 @@ namespace MoMoney.boot.container.registration
concerns_for<IStartupCommand, auto_wire_components_in_to_the>
{
context c = () =>
- {
- exclusions_criteria = the_dependency<IComponentExclusionSpecification>();
- builder = the_dependency<IDependencyRegistration>();
- };
+ {
+ exclusions_criteria = the_dependency<ComponentExclusionSpecification>();
+ builder = the_dependency<DependencyRegistration>();
+ };
public override IStartupCommand create_sut()
{
return new auto_wire_components_in_to_the(builder, exclusions_criteria);
}
- static protected IDependencyRegistration builder;
- static protected IComponentExclusionSpecification exclusions_criteria;
+ static protected DependencyRegistration builder;
+ static protected ComponentExclusionSpecification exclusions_criteria;
}
public class when_registering_all_the_components_from_an_assembly :
@@ -40,51 +40,39 @@ namespace MoMoney.boot.container.registration
() => builder.was_not_told_to(x => x.transient(bad_type, bad_type));
context c = () =>
- {
- assembly = an<IAssembly>();
- interface_type = typeof (ITestComponent);
- component_with_multiple_interfaces = typeof (TestComponent);
- component_with_no_interface = typeof (ComponentNoInterface);
- bad_type = typeof (BadComponent);
-
- when_the(assembly).is_told_to(x => x.all_types())
- .it_will_return(component_with_multiple_interfaces, component_with_no_interface,
- bad_type);
- when_the(exclusions_criteria).is_told_to(x => x.is_satisfied_by(bad_type))
- .it_will_return(false);
- };
+ {
+ assembly = an<Assembly>();
+ interface_type = typeof (ITestComponent);
+ component_with_multiple_interfaces = typeof (TestComponent);
+ component_with_no_interface = typeof (ComponentNoInterface);
+ bad_type = typeof (BadComponent);
+
+ when_the(assembly).is_told_to(x => x.all_types())
+ .it_will_return(component_with_multiple_interfaces, component_with_no_interface,
+ bad_type);
+ when_the(exclusions_criteria).is_told_to(x => x.is_satisfied_by(bad_type))
+ .it_will_return(false);
+ };
because b = () => sut.run(assembly);
- static IAssembly assembly;
+ static Assembly assembly;
static Type component_with_multiple_interfaces;
static Type interface_type;
static Type component_with_no_interface;
static Type bad_type;
}
- public interface IBaseComponent
- {
- }
+ public interface IBaseComponent {}
- public interface ITestComponent
- {
- }
+ public interface ITestComponent {}
- public class BaseComponent : IBaseComponent
- {
- }
+ public class BaseComponent : IBaseComponent {}
- public class TestComponent : BaseComponent, ITestComponent
- {
- }
+ public class TestComponent : BaseComponent, ITestComponent {}
- public class ComponentNoInterface
- {
- }
+ public class ComponentNoInterface {}
- public class BadComponent
- {
- }
+ public class BadComponent {}
}
\ No newline at end of file
product/Boot/boot/container/registration/IStartupCommand.cs
@@ -1,9 +1,7 @@
using Gorilla.Commons.Infrastructure.Reflection;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration
{
- public interface IStartupCommand : ICommand, IParameterizedCommand<IAssembly>
- {
- }
+ public interface IStartupCommand : Command, ParameterizedCommand<Assembly> {}
}
\ No newline at end of file
product/Boot/boot/container/registration/wire_up_the_data_access_components_into_the.cs
@@ -1,22 +1,21 @@
-using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Cloning;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.utility;
using MoMoney.boot.container.registration.proxy_configuration;
-using MoMoney.DataAccess;
-using MoMoney.DataAccess.Db40;
-using MoMoney.DataAccess.Transactions;
+using momoney.database;
+using momoney.database.db4o;
+using momoney.database.transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
using MoMoney.Service.Infrastructure.Transactions;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_data_access_components_into_the : ICommand
+ class wire_up_the_data_access_components_into_the : Command
{
- readonly IDependencyRegistration register;
+ readonly DependencyRegistration register;
- public wire_up_the_data_access_components_into_the(IDependencyRegistration registry)
+ public wire_up_the_data_access_components_into_the(DependencyRegistration registry)
{
register = registry;
}
product/Boot/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -1,24 +1,25 @@
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Infrastructure.Log4Net;
+using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Log4Net;
+using gorilla.commons.utility;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_essential_services_into_the : ICommand
+ class wire_up_the_essential_services_into_the : Command
{
- readonly IDependencyRegistration registration;
+ readonly DependencyRegistration registration;
- public wire_up_the_essential_services_into_the(IDependencyRegistration registration)
+ public wire_up_the_essential_services_into_the(DependencyRegistration registration)
{
this.registration = registration;
}
public void run()
{
- registration.singleton(() => registration);
- registration.singleton(() => registration.build());
- registration.singleton<ILogFactory, Log4NetLogFactory>();
+ registration.singleton<DependencyRegistration>(() => registration);
+ registration.singleton<DependencyRegistry>(() => registration.build());
+ registration.singleton<LogFactory, Log4NetLogFactory>();
}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/wire_up_the_infrastructure_in_to_the.cs
@@ -1,23 +1,25 @@
using System.Collections;
using System.ComponentModel;
using System.Deployment.Application;
-using Gorilla.Commons.Infrastructure;
using Gorilla.Commons.Infrastructure.Registries;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.DataAccess.Transactions;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.utility;
+using momoney.database.transactions;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
+using momoney.service.infrastructure.threading;
using MoMoney.Service.Infrastructure.Threading;
+using momoney.service.infrastructure.updating;
using MoMoney.Service.Infrastructure.Updating;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_infrastructure_in_to_the : ICommand
+ class wire_up_the_infrastructure_in_to_the : Command
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_infrastructure_in_to_the(IDependencyRegistration registry)
+ public wire_up_the_infrastructure_in_to_the(DependencyRegistration registry)
{
this.registry = registry;
}
@@ -27,10 +29,10 @@ namespace MoMoney.boot.container.registration
registry.singleton<IEventAggregator, EventAggregator>();
registry.singleton<ITimer, IntervalTimer>();
registry.singleton<IProjectController, ProjectController>();
- registry.transient(typeof (IRegistry<>), typeof (DefaultRegistry<>));
+ registry.transient(typeof (Registry<>), typeof (DefaultRegistry<>));
registry.transient(typeof (ITrackerEntryMapper<>), typeof (TrackerEntryMapper<>));
registry.transient(typeof (IKey<>), typeof (TypedKey<>));
- registry.transient(typeof (IComponentFactory<>), typeof (ComponentFactory<>));
+ registry.transient(typeof (ComponentFactory<>), typeof (DefaultConstructorFactory<>));
registry.singleton<IContext>(() => new Context(new Hashtable()));
registry.singleton(() => AsyncOperationManager.SynchronizationContext);
product/Boot/boot/container/registration/wire_up_the_mappers_in_to_the.cs
@@ -1,40 +1,39 @@
using System;
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.DTO;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_mappers_in_to_the : ICommand
+ class wire_up_the_mappers_in_to_the : Command
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_mappers_in_to_the(IDependencyRegistration registry)
+ public wire_up_the_mappers_in_to_the(DependencyRegistration registry)
{
this.registry = registry;
}
public void run()
{
- registry.transient(typeof (IMapper<,>), typeof (Mapper<,>));
+ registry.transient(typeof (Mapper<,>), typeof (AnonymousMapper<,>));
registry.singleton<Converter<IBill, BillInformationDTO>>(
() => x => new BillInformationDTO
- {
- company_name = x.company_to_pay.name,
- the_amount_owed = x.the_amount_owed.ToString(),
- due_date = x.due_date.to_date_time(),
- });
+ {
+ company_name = x.company_to_pay.name,
+ the_amount_owed = x.the_amount_owed.ToString(),
+ due_date = x.due_date.to_date_time(),
+ });
registry.singleton<Converter<ICompany, CompanyDTO>>(() => x => new CompanyDTO {id = x.id, name = x.name});
registry.singleton<Converter<IIncome, IncomeInformationDTO>>(
() => x => new IncomeInformationDTO
- {
- amount = x.amount_tendered.to_string(),
- company = x.company.to_string(),
- recieved_date = x.date_of_issue.to_string(),
- });
+ {
+ amount = x.amount_tendered.to_string(),
+ company = x.company.to_string(),
+ recieved_date = x.date_of_issue.to_string(),
+ });
}
}
}
\ No newline at end of file
product/Boot/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -1,35 +1,34 @@
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 gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
using MoMoney.boot.container.registration.proxy_configuration;
using MoMoney.Presentation;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Menu.Help;
using MoMoney.Presentation.Model.Menu.window;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_presentation_modules : ICommand, IParameterizedCommand<IAssembly>
+ class wire_up_the_presentation_modules : Command, ParameterizedCommand<Assembly>
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_presentation_modules(IDependencyRegistration registry)
+ public wire_up_the_presentation_modules(DependencyRegistration registry)
{
this.registry = registry;
}
public void run()
{
- run(new ApplicationAssembly(Assembly.GetExecutingAssembly()));
+ run(new ApplicationAssembly(System.Reflection.Assembly.GetExecutingAssembly()));
}
- public void run(IAssembly item)
+ public void run(Assembly item)
{
Func<IApplicationController> target =
() => new ApplicationController(Lazy.load<IPresenterRegistry>(), Lazy.load<IShell>());
product/Boot/boot/container/registration/wire_up_the_reports_in_to_the.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Presenters;
@@ -10,11 +10,11 @@ using MoMoney.Service.Contracts.Application;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_reports_in_to_the : ICommand
+ class wire_up_the_reports_in_to_the : Command
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_reports_in_to_the(IDependencyRegistration registry)
+ public wire_up_the_reports_in_to_the(DependencyRegistration registry)
{
this.registry = registry;
}
@@ -22,9 +22,9 @@ namespace MoMoney.boot.container.registration
public void run()
{
registry.transient<IReportViewer, ReportViewer>();
- registry.transient(typeof (IPresenter), typeof (ReportPresenter<IViewAllBillsReport,IEnumerable<BillInformationDTO>,IGetAllBillsQuery>));
+ registry.transient(typeof (IPresenter), typeof (ReportPresenter<IViewAllBillsReport, IEnumerable<BillInformationDTO>, IGetAllBillsQuery>));
registry.transient<IViewAllBillsReport, ViewAllBillsReport>();
- registry.transient(typeof (IPresenter), typeof (ReportPresenter<IViewAllIncomeReport,IEnumerable<IncomeInformationDTO>,IGetAllIncomeQuery>));
+ registry.transient(typeof (IPresenter), typeof (ReportPresenter<IViewAllIncomeReport, IEnumerable<IncomeInformationDTO>, IGetAllIncomeQuery>));
registry.transient<IViewAllIncomeReport, ViewAllIncomeReport>();
}
}
product/Boot/boot/container/registration/wire_up_the_services_in_to_the.cs
@@ -1,5 +1,6 @@
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
using MoMoney.boot.container.registration.proxy_configuration;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
@@ -9,11 +10,11 @@ using MoMoney.Service.Contracts.Application;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_services_in_to_the : ICommand
+ class wire_up_the_services_in_to_the : Command
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_services_in_to_the(IDependencyRegistration registry)
+ public wire_up_the_services_in_to_the(DependencyRegistration registry)
{
this.registry = registry;
}
@@ -28,14 +29,14 @@ namespace MoMoney.boot.container.registration
{
registry.proxy<IGetAllCompanysQuery, ServiceLayerConfiguration<IGetAllCompanysQuery>>(
() =>
- new GetAllCompanysQuery(Lazy.load<ICompanyRepository>(), Lazy.load<IMapper<ICompany, CompanyDTO>>()));
+ new GetAllCompanysQuery(Lazy.load<ICompanyRepository>(), Lazy.load<Mapper<ICompany, CompanyDTO>>()));
registry.proxy<IGetAllBillsQuery, ServiceLayerConfiguration<IGetAllBillsQuery>>(
() =>
- new GetAllBillsQuery(Lazy.load<IBillRepository>(), Lazy.load<IMapper<IBill, BillInformationDTO>>()));
+ new GetAllBillsQuery(Lazy.load<IBillRepository>(), Lazy.load<Mapper<IBill, BillInformationDTO>>()));
registry.proxy<IGetAllIncomeQuery, ServiceLayerConfiguration<IGetAllIncomeQuery>>(
() =>
new GetAllIncomeQuery(Lazy.load<IIncomeRepository>(),
- Lazy.load<IMapper<IIncome, IncomeInformationDTO>>()));
+ Lazy.load<Mapper<IIncome, IncomeInformationDTO>>()));
registry.proxy<IGetTheCurrentCustomerQuery, ServiceLayerConfiguration<IGetTheCurrentCustomerQuery>>(
() => new GetTheCurrentCustomerQuery(Lazy.load<IAccountHolderRepository>()));
}
@@ -44,14 +45,14 @@ namespace MoMoney.boot.container.registration
{
registry.proxy<IRegisterNewCompanyCommand, ServiceLayerConfiguration<IRegisterNewCompanyCommand>>(
() =>
- new RegisterNewCompanyCommand(Lazy.load<ICompanyFactory>(), Lazy.load<INotification>(),
+ new RegisterNewCompanyCommand(Lazy.load<ICompanyFactory>(), Lazy.load<Notification>(),
Lazy.load<ICompanyRepository>()));
registry.proxy<ISaveNewBillCommand, ServiceLayerConfiguration<ISaveNewBillCommand>>(
() => new SaveNewBillCommand(Lazy.load<ICompanyRepository>(), Lazy.load<IGetTheCurrentCustomerQuery>()));
registry.proxy<IAddNewIncomeCommand, ServiceLayerConfiguration<IAddNewIncomeCommand>>(
() =>
- new AddNewIncomeCommand(Lazy.load<IGetTheCurrentCustomerQuery>(), Lazy.load<INotification>(),
+ new AddNewIncomeCommand(Lazy.load<IGetTheCurrentCustomerQuery>(), Lazy.load<Notification>(),
Lazy.load<IIncomeRepository>(), Lazy.load<ICompanyRepository>()));
}
}
product/Boot/boot/container/registration/wire_up_the_views_in_to_the.cs
@@ -1,17 +1,18 @@
using System.ComponentModel;
using System.Windows.Forms;
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.utility;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Views;
namespace MoMoney.boot.container.registration
{
- class wire_up_the_views_in_to_the : ICommand
+ class wire_up_the_views_in_to_the : Command
{
- readonly IDependencyRegistration register;
+ readonly DependencyRegistration register;
- public wire_up_the_views_in_to_the(IDependencyRegistration registry)
+ public wire_up_the_views_in_to_the(DependencyRegistration registry)
{
register = registry;
}
product/Boot/boot/container/ComponentExclusionSpecification.cs
@@ -1,10 +1,10 @@
using System;
-using Gorilla.Commons.Infrastructure.Castle.Windsor.Configuration;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.infrastructure.thirdparty.Castle.Windsor.Configuration;
+using gorilla.commons.utility;
namespace MoMoney.boot.container
{
- public class ComponentExclusionSpecification : IComponentExclusionSpecification
+ public class ComponentExclusionSpecificationImplementation : ComponentExclusionSpecification
{
public bool is_satisfied_by(Type type)
{
product/Boot/boot/container/ComponentExclusionSpecificationSpecs.cs
@@ -3,24 +3,25 @@ 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.infrastructure.thirdparty.Castle.Windsor.Configuration;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.Core;
namespace MoMoney.boot.container
{
public abstract class behaves_like_component_exclusion_specification :
- concerns_for<IComponentExclusionSpecification, ComponentExclusionSpecification>
- {
- }
+ concerns_for<ComponentExclusionSpecification, ComponentExclusionSpecificationImplementation> {}
public class when_checking_if_a_windows_form_should_be_excluded : behaves_like_component_exclusion_specification
{
it should_be_excluded = () => result.should_be_true();
- because b = () => { result = sut.is_satisfied_by(typeof (FakeForm)); };
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(typeof (FakeForm));
+ };
static bool result;
}
@@ -30,7 +31,10 @@ namespace MoMoney.boot.container
{
it should_be_excluded = () => result.should_be_true();
- because b = () => { result = sut.is_satisfied_by(typeof (FakeDependencyRegistry)); };
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(typeof (FakeDependencyRegistry));
+ };
static bool result;
}
@@ -39,7 +43,10 @@ namespace MoMoney.boot.container
{
it should_be_excluded = () => result.should_be_true();
- because b = () => { result = sut.is_satisfied_by(typeof (FakeStaticClass)); };
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(typeof (FakeStaticClass));
+ };
static bool result;
}
@@ -48,7 +55,10 @@ namespace MoMoney.boot.container
{
it should_be_excluded = () => result.should_be_true();
- because b = () => { result = sut.is_satisfied_by(typeof (FakeEntity)); };
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(typeof (FakeEntity));
+ };
static bool result;
}
@@ -57,31 +67,30 @@ namespace MoMoney.boot.container
{
it should_be_excluded = () => result.should_be_true();
- because b = () => { result = sut.is_satisfied_by(typeof (IDbConnection)); };
+ because b = () =>
+ {
+ result = sut.is_satisfied_by(typeof (IDbConnection));
+ };
static bool result;
}
- public class FakeForm : Form
- {
- }
+ public class FakeForm : Form {}
- public class FakeDependencyRegistry : IDependencyRegistry
+ public class FakeDependencyRegistry : DependencyRegistry
{
public Interface get_a<Interface>()
{
throw new NotImplementedException();
}
- public IEnumerable<Interface> all_the<Interface>()
+ public IEnumerable<Contract> get_all<Contract>()
{
throw new NotImplementedException();
}
}
- static public class FakeStaticClass
- {
- }
+ static public class FakeStaticClass {}
public class FakeEntity : IEntity
{
product/Boot/boot/container/tear_down_the_container.cs
@@ -1,9 +1,9 @@
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.boot.container
{
- class tear_down_the_container : ICommand
+ class tear_down_the_container : Command
{
public void run()
{
product/Boot/boot/container/type_extensions.cs
@@ -1,39 +1,39 @@
using System;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.Core;
namespace MoMoney.boot.container
{
static public class type_extensions
{
- static public ISpecification<Type> has_no_interfaces(this Type item)
+ static public Specification<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)
+ static public Specification<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)
+ static public Specification<Type> is_an_implementation_of_dependency_registry(this Type item)
{
- return new PredicateSpecification<Type>(x => typeof (IDependencyRegistry).IsAssignableFrom(x));
+ return new PredicateSpecification<Type>(x => typeof (DependencyRegistry).IsAssignableFrom(x));
}
- static public ISpecification<Type> is_an_entity(this Type item)
+ static public Specification<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)
+ static public Specification<Type> is_an_interface(this Type item)
{
return new PredicateSpecification<Type>(x => x.IsInterface);
}
- static public ISpecification<Type> is_abstract(this Type item)
+ static public Specification<Type> is_abstract(this Type item)
{
return new PredicateSpecification<Type>(x => x.IsAbstract);
}
product/Boot/boot/container/wire_up_the_container.cs
@@ -1,21 +1,18 @@
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Infrastructure.Autofac;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.infrastructure.thirdparty;
+using gorilla.commons.infrastructure.thirdparty.Autofac;
+using gorilla.commons.utility;
using MoMoney.boot.container.registration;
namespace MoMoney.boot.container
{
- class wire_up_the_container : ICommand
+ class wire_up_the_container : Command
{
- readonly IDependencyRegistration registry;
+ readonly DependencyRegistration registry;
- public wire_up_the_container() : this(new AutofacDependencyRegistryBuilder())
- {
- }
+ public wire_up_the_container() : this(new AutofacDependencyRegistryBuilder()) {}
- public wire_up_the_container(IDependencyRegistration registry)
+ public wire_up_the_container(DependencyRegistration registry)
{
this.registry = registry;
}
product/Boot/boot/display_the_splash_screen.cs
@@ -1,10 +1,10 @@
using System;
+using gorilla.commons.Utility;
using MoMoney.Presentation.Presenters;
-using MoMoney.Utility.Core;
namespace MoMoney.boot
{
- public class display_the_splash_screen : IDisposableCommand
+ public class display_the_splash_screen : DisposableCommand
{
readonly Func<ISplashScreenPresenter> presenter;
product/Boot/boot/global_error_handling.cs
@@ -2,14 +2,13 @@ using System;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Model.messages;
+using gorilla.commons.utility;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.boot
{
- class global_error_handling : ICommand
+ class global_error_handling : Command
{
public void run()
{
product/Boot/boot/hookup.cs
@@ -1,10 +1,8 @@
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.boot
+namespace momoney.boot
{
class hookup
{
- static public Command the<Command>() where Command : ICommand, new()
+ static public Command the<Command>() where Command : gorilla.commons.utility.Command, new()
{
return new Command();
}
product/Boot/boot/start_the_application.cs
@@ -1,20 +1,19 @@
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
using MoMoney.Modules.Core;
+using momoney.service.infrastructure.threading;
using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.boot
{
- class start_the_application : ICommand
+ class start_the_application : Command
{
readonly IBackgroundThread thread;
readonly ILoadPresentationModulesCommand command;
readonly ICommandProcessor processor;
public start_the_application(IBackgroundThread thread)
- : this(thread, Lazy.load<ILoadPresentationModulesCommand>(), Lazy.load<ICommandProcessor>())
- {
- }
+ : this(thread, Lazy.load<ILoadPresentationModulesCommand>(), Lazy.load<ICommandProcessor>()) {}
public start_the_application(IBackgroundThread thread, ILoadPresentationModulesCommand command,
ICommandProcessor processor)
product/Boot/boot/WindowsFormsApplication.cs
@@ -8,17 +8,17 @@ using System.Threading;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
+using momoney.boot;
using MoMoney.boot.container;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
-using MoMoney.Service.Infrastructure.Threading;
+using momoney.service.infrastructure.threading;
namespace MoMoney.boot
{
- public class WindowsFormsApplication<Shell> : ICommand where Shell : Form
+ public class WindowsFormsApplication<Shell> : Command where Shell : Form
{
protected WindowsFormsApplication()
{
@@ -67,9 +67,7 @@ namespace MoMoney.boot
{
readonly IServiceContainer container;
- public ApplicationContainer() : this(new ServiceContainer())
- {
- }
+ public ApplicationContainer() : this(new ServiceContainer()) {}
public ApplicationContainer(IServiceContainer container)
{
product/Boot/Modules/Core/ILoadPresentationModulesCommand.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Modules.Core
{
- public interface ILoadPresentationModulesCommand : ICommand
- {
- }
+ public interface ILoadPresentationModulesCommand : Command {}
}
\ No newline at end of file
product/Boot/Modules/Core/LoadPresentationModulesCommand.cs
@@ -1,5 +1,4 @@
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation;
using MoMoney.Service.Infrastructure.Threading;
@@ -7,10 +6,10 @@ namespace MoMoney.Modules.Core
{
public class LoadPresentationModulesCommand : ILoadPresentationModulesCommand
{
- readonly IRegistry<IModule> registry;
+ readonly Registry<IModule> registry;
readonly ICommandProcessor processor;
- public LoadPresentationModulesCommand(IRegistry<IModule> registry, ICommandProcessor processor)
+ public LoadPresentationModulesCommand(Registry<IModule> registry, ICommandProcessor processor)
{
this.registry = registry;
this.processor = processor;
product/Boot/Modules/Core/LoadPresentationModulesCommandSpecs.cs
@@ -1,6 +1,6 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation;
using MoMoney.Service.Infrastructure.Threading;
@@ -13,16 +13,16 @@ namespace MoMoney.Modules.Core
it should_initialize_all_the_presentation_modules = () => processor.was_told_to(x => x.add(module));
context c = () =>
- {
- registry = the_dependency<IRegistry<IModule>>();
- processor = the_dependency<ICommandProcessor>();
- module = an<IModule>();
- when_the(registry).is_told_to(r => r.all()).it_will_return(module);
- };
+ {
+ registry = the_dependency<Registry<IModule>>();
+ processor = the_dependency<ICommandProcessor>();
+ module = an<IModule>();
+ when_the(registry).is_told_to(r => r.all()).it_will_return(module);
+ };
because b = () => sut.run();
- static IRegistry<IModule> registry;
+ static Registry<IModule> registry;
static IModule module;
static ICommandProcessor processor;
}
product/Boot/Modules/ApplicationMenuModule.cs
@@ -1,5 +1,6 @@
+using momoney.presentation.model.events;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
product/Boot/Modules/ApplicationShellModule.cs
@@ -1,4 +1,5 @@
using MoMoney.Presentation;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Presenters;
namespace MoMoney.Modules
product/Boot/Modules/DatabaseModule.cs
@@ -1,4 +1,4 @@
-using MoMoney.DataAccess;
+using momoney.database;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/GettingStartedModule.cs
@@ -1,5 +1,6 @@
using MoMoney.Presentation;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
product/Boot/Modules/IApplicationMenuModule.cs
@@ -1,5 +1,5 @@
using MoMoney.Presentation;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/IMainMenuModule.cs
@@ -1,5 +1,5 @@
using MoMoney.Presentation;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/IToolbarModule.cs
@@ -1,5 +1,5 @@
using MoMoney.Presentation;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Modules
product/Boot/Modules/MainMenuModule.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
product/Boot/Modules/ToolbarModule.cs
@@ -1,5 +1,6 @@
+using momoney.presentation.model.events;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Presenters;
using MoMoney.Service.Infrastructure.Eventing;
product/Boot/Properties/Resources.Designer.cs
@@ -1,14 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.3082
+// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
-namespace MoMoney.Properties {
+namespace momoney.Properties {
+ using System;
+
+
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -36,7 +39,7 @@ namespace MoMoney.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- var temp = new global::System.Resources.ResourceManager("MoMoney.Properties.Resources", typeof(Resources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("momoney.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
product/Boot/Properties/Settings.Designer.cs
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.3082
+// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
-namespace MoMoney.Properties {
+namespace momoney.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
product/Boot/Boot.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{2DB82691-BF15-4538-8C5E-6BF8F4F875A9}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney</RootNamespace>
- <AssemblyName>MoMoney</AssemblyName>
+ <RootNamespace>momoney</RootNamespace>
+ <AssemblyName>momoney</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@@ -47,15 +47,19 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\build\lib\test\developwithpassion\developwithpassion.bdd.dll</HintPath>
</Reference>
- <Reference Include="gorilla.commons.infrastructure, Version=2009.5.5.1633, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
+ <Reference Include="gorilla.commons.infrastructure, Version=2009.10.21.739, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\build\lib\app\gorilla\gorilla.commons.infrastructure.dll</HintPath>
</Reference>
- <Reference Include="gorilla.commons.infrastructure.thirdparty, Version=2009.5.5.1633, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
+ <Reference Include="gorilla.commons.infrastructure.thirdparty, Version=2009.10.21.739, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\build\lib\app\gorilla\gorilla.commons.infrastructure.thirdparty.dll</HintPath>
</Reference>
- <Reference Include="gorilla.commons.utility, Version=2009.5.5.1633, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
+ <Reference Include="gorilla.commons.infrastructure.thirdparty.log4net, Version=2009.10.21.739, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\build\lib\app\gorilla\gorilla.commons.infrastructure.thirdparty.log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="gorilla.commons.utility, Version=2009.10.21.739, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\build\lib\app\gorilla\gorilla.commons.utility.dll</HintPath>
</Reference>
@@ -158,23 +162,23 @@
<Compile Include="boot\display_the_splash_screen.cs" />
<Compile Include="boot\global_error_handling.cs" />
<Compile Include="boot\WindowsFormsApplication.cs" />
- <Compile Include="Modules\ApplicationShellModule.cs" />
- <Compile Include="Modules\Core\ILoadPresentationModulesCommand.cs" />
- <Compile Include="Modules\DatabaseModule.cs" />
- <Compile Include="Modules\ApplicationMenuModule.cs" />
- <Compile Include="Modules\IApplicationMenuModule.cs" />
- <Compile Include="Modules\IDatabaseModule.cs" />
- <Compile Include="Modules\IMainMenuModule.cs" />
- <Compile Include="Modules\INavigationModule.cs" />
- <Compile Include="Modules\IToolbarModule.cs" />
- <Compile Include="Modules\MainMenuModule.cs" />
- <Compile Include="Modules\NavigationModule.cs" />
- <Compile Include="Modules\GettingStartedModule.cs" />
- <Compile Include="Modules\GettingStartedModuleSpecs.cs" />
- <Compile Include="Modules\ToolbarModule.cs" />
- <Compile Include="Modules\Core\LoadPresentationModulesCommandSpecs.cs" />
+ <Compile Include="modules\ApplicationShellModule.cs" />
+ <Compile Include="modules\core\ILoadPresentationModulesCommand.cs" />
+ <Compile Include="modules\DatabaseModule.cs" />
+ <Compile Include="modules\ApplicationMenuModule.cs" />
+ <Compile Include="modules\IApplicationMenuModule.cs" />
+ <Compile Include="modules\IDatabaseModule.cs" />
+ <Compile Include="modules\IMainMenuModule.cs" />
+ <Compile Include="modules\INavigationModule.cs" />
+ <Compile Include="modules\IToolbarModule.cs" />
+ <Compile Include="modules\MainMenuModule.cs" />
+ <Compile Include="modules\NavigationModule.cs" />
+ <Compile Include="modules\GettingStartedModule.cs" />
+ <Compile Include="modules\GettingStartedModuleSpecs.cs" />
+ <Compile Include="modules\ToolbarModule.cs" />
+ <Compile Include="modules\core\LoadPresentationModulesCommandSpecs.cs" />
<Compile Include="boot\hookup.cs" />
- <Compile Include="Modules\Core\LoadPresentationModulesCommand.cs" />
+ <Compile Include="modules\core\LoadPresentationModulesCommand.cs" />
<Compile Include="bootstrap.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@@ -203,29 +207,29 @@
<Compile Include="boot\container\registration\wire_up_the_views_in_to_the.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\DataAccess\DataAccess.csproj">
+ <ProjectReference Include="..\database\database.csproj">
<Project>{580E68A8-EDEE-4350-8BBE-A053645B0F83}</Project>
- <Name>DataAccess</Name>
+ <Name>database</Name>
</ProjectReference>
- <ProjectReference Include="..\Domain\Domain.csproj">
+ <ProjectReference Include="..\Domain\domain.csproj">
<Project>{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}</Project>
- <Name>Domain</Name>
+ <Name>domain</Name>
</ProjectReference>
- <ProjectReference Include="..\DTO\DTO.csproj">
+ <ProjectReference Include="..\DTO\dto.csproj">
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
- <Name>DTO</Name>
+ <Name>dto</Name>
</ProjectReference>
- <ProjectReference Include="..\Presentation\Presentation.csproj">
+ <ProjectReference Include="..\Presentation\presentation.csproj">
<Project>{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}</Project>
- <Name>Presentation</Name>
+ <Name>presentation</Name>
</ProjectReference>
- <ProjectReference Include="..\Service\Service.csproj">
+ <ProjectReference Include="..\Service\service.csproj">
<Project>{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}</Project>
- <Name>Service</Name>
+ <Name>service</Name>
</ProjectReference>
- <ProjectReference Include="..\Service.Contracts\Service.Contracts.csproj">
+ <ProjectReference Include="..\Service.Contracts\service.contracts.csproj">
<Project>{41D2B68B-031B-44FF-BAC5-7752D9E29F94}</Project>
- <Name>Service.Contracts</Name>
+ <Name>service.contracts</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
product/DataAccess/Db40/Spiking/db40_spike_specs.cs
@@ -1,91 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using Db4objects.Db4o;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Extensions;
-
-namespace MoMoney.DataAccess.db40.spiking
-{
- [Concern(typeof (Db4oFactory))]
- public class when_opening_an_existing_database_ : concerns
- {
- before_each_observation be = () => { };
-
- context c = () =>
- {
- original = new TestObject(88, "mo");
- the_database_file = Path.GetTempFileName();
- var configuration = Db4oFactory.NewConfiguration();
- configuration.LockDatabaseFile(false);
- database = Db4oFactory.OpenFile(configuration, the_database_file);
- };
-
- because b = () =>
- {
- database.Store(original);
- database.Close();
- database.Dispose();
- database = Db4oFactory.OpenFile(the_database_file);
- results = database.Query<ITestObject>().databind();
- };
-
- it should_be_able_to_load_the_original_contents = () => results.should_contain(original);
-
- it they_should_be_equal = () => new TestObject(99, "gretzky").Equals(new TestObject(99, "gretzky"));
-
- it should_only_contain_the_original_item = () => results.Count.should_be_equal_to(1);
-
- after_each_observation ae = () =>
- {
- database.Close();
- database.Dispose();
- };
-
- static ITestObject original;
- static string the_database_file;
- static IList<ITestObject> results;
- static IObjectContainer database;
- }
-
- public interface ITestObject
- {
- int Id { get; }
- string Name { get; }
- }
-
- public class TestObject : ITestObject
- {
- public TestObject(int id, string name)
- {
- Id = id;
- Name = name;
- }
-
- public int Id { get; private set; }
- public string Name { get; private set; }
-
- public bool Equals(TestObject obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- return obj.Id == Id && Equals(obj.Name, Name);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != typeof (TestObject)) return false;
- return Equals((TestObject) obj);
- }
-
- public override int GetHashCode()
- {
- unchecked
- {
- return (Id*397) ^ (Name != null ? Name.GetHashCode() : 0);
- }
- }
- }
-}
\ No newline at end of file
product/DataAccess/Db40/ConfigureDatabaseStep.cs
@@ -1,20 +0,0 @@
-using Db4objects.Db4o.Config;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Db40
-{
- public interface IConfigureDatabaseStep : IConfiguration<IConfiguration>
- {
- }
-
- public class ConfigureDatabaseStep : IConfigureDatabaseStep
- {
- public void configure(IConfiguration item)
- {
- item.LockDatabaseFile(false);
- //item.UpdateDepth(10);
- //item.WeakReferences(true);
- //item.AutomaticShutDown(true);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Db40/ConfigureObjectContainerStep.cs
@@ -1,22 +0,0 @@
-using Db4objects.Db4o;
-using Db4objects.Db4o.Events;
-using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Db40
-{
- public interface IConfigureObjectContainerStep : IConfiguration<IObjectContainer>
- {
- }
-
- public class ConfigureObjectContainerStep : IConfigureObjectContainerStep
- {
- public void configure(IObjectContainer item)
- {
- var registry = EventRegistryFactory.ForObjectContainer(item);
- registry.ClassRegistered += (sender, args) => this.log().debug("class registered: {0}", args.ClassMetadata());
- registry.Instantiated += (sender, args) => this.log().debug("class instantiated: {0}", args.Object.GetType().Name);
- registry.Committed += (sender, args) => this.log().debug("added: {0}, updated: {1}, deleted: {2}", args.Added, args.Updated, args.Deleted);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Db40/ConnectionFactory.cs
@@ -1,34 +0,0 @@
-using Db4objects.Db4o;
-using Db4objects.Db4o.Config;
-using Gorilla.Commons.Infrastructure.FileSystem;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.DataAccess.Transactions;
-
-namespace MoMoney.DataAccess.Db40
-{
- public class ConnectionFactory : IConnectionFactory
- {
- readonly IConfigureDatabaseStep setup;
- readonly IConfigureObjectContainerStep setup_container;
-
- public ConnectionFactory(IConfigureDatabaseStep setup, IConfigureObjectContainerStep setup_container)
- {
- this.setup = setup;
- this.setup_container = setup_container;
- }
-
- public IDatabaseConnection open_connection_to(IFile the_path_to_the_database_file)
- {
- var configuration = Db4oFactory.NewConfiguration();
- setup.configure(configuration);
- return new DatabaseConnection(get_container(the_path_to_the_database_file, configuration));
- }
-
- IObjectContainer get_container(IFile the_path_to_the_database_file, IConfiguration configuration)
- {
- return Db4oFactory
- .OpenFile(configuration, the_path_to_the_database_file.path)
- .and_configure_with(setup_container);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Db40/DatabaseConnection.cs
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Db4objects.Db4o;
-using MoMoney.DataAccess.Transactions;
-
-namespace MoMoney.DataAccess.Db40
-{
- public class DatabaseConnection : IDatabaseConnection
- {
- readonly IObjectContainer container;
-
- public DatabaseConnection(IObjectContainer container)
- {
- this.container = container;
- }
-
- public void Dispose()
- {
- container.Close();
- container.Dispose();
- }
-
- public IEnumerable<T> query<T>()
- {
- return container.Query<T>();
- }
-
- public IEnumerable<T> query<T>(Predicate<T> predicate)
- {
- return container.Query(predicate);
- }
-
- public void delete<T>(T entity)
- {
- container.Delete(entity);
- }
-
- public void commit()
- {
- container.Commit();
- }
-
- public void store<T>(T entity)
- {
- container.Store(entity);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Repositories/AccountHolderRepository.cs
@@ -1,27 +0,0 @@
-using System.Collections.Generic;
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Domain.accounting;
-using MoMoney.Domain.repositories;
-
-namespace MoMoney.DataAccess.repositories
-{
- public class AccountHolderRepository : IAccountHolderRepository
- {
- readonly ISession session;
-
- public AccountHolderRepository(ISession session)
- {
- this.session = session;
- }
-
- public IEnumerable<IAccountHolder> all()
- {
- return session.all<IAccountHolder>();
- }
-
- public void save(IAccountHolder account_holder)
- {
- session.save(account_holder);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Repositories/BillRepository.cs
@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Domain.Accounting;
-using MoMoney.Domain.repositories;
-
-namespace MoMoney.DataAccess.repositories
-{
- public class BillRepository : IBillRepository
- {
- readonly ISession session;
-
- public BillRepository(ISession session)
- {
- this.session = session;
- }
-
- public IEnumerable<IBill> all()
- {
- return session.all<IBill>();
- }
- }
-}
\ No newline at end of file
product/DataAccess/Repositories/CompanyRepository.cs
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Domain.Accounting;
-using MoMoney.Domain.repositories;
-
-namespace MoMoney.DataAccess.repositories
-{
- public class CompanyRepository : ICompanyRepository
- {
- readonly ISession session;
-
- public CompanyRepository(ISession session)
- {
- this.session = session;
- }
-
- public IEnumerable<ICompany> all()
- {
- return session.all<ICompany>();
- }
-
- public ICompany find_company_named(string name)
- {
- return session
- .all<ICompany>()
- .SingleOrDefault(x => x.name.is_equal_to_ignoring_case(name));
- }
-
- public ICompany find_company_by(Guid id)
- {
- return session.all<ICompany>().SingleOrDefault(x => x.id.Equals(id));
- }
-
- public void save(ICompany company)
- {
- session.save(company);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Repositories/IncomeRepository.cs
@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Domain.Accounting;
-using MoMoney.Domain.repositories;
-
-namespace MoMoney.DataAccess.repositories
-{
- public class IncomeRepository : IIncomeRepository
- {
- readonly ISession session;
-
- public IncomeRepository(ISession session)
- {
- this.session = session;
- }
-
- public IEnumerable<IIncome> all()
- {
- return session.all<IIncome>();
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ChangeTracker.cs
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class ChangeTracker<T> : IChangeTracker<T> where T : IIdentifiable<Guid>
- {
- readonly ITrackerEntryMapper<T> mapper;
- readonly IStatementRegistry registry;
- readonly IList<ITrackerEntry<T>> items;
- readonly IList<T> to_be_deleted;
-
- public ChangeTracker(ITrackerEntryMapper<T> mapper, IStatementRegistry registry)
- {
- this.mapper = mapper;
- this.registry = registry;
- items = new List<ITrackerEntry<T>>();
- to_be_deleted = new List<T>();
- }
-
- public void register(T entity)
- {
- items.Add(mapper.map_from(entity));
- }
-
- public void delete(T entity)
- {
- to_be_deleted.Add(entity);
- }
-
- public void commit_to(IDatabase database)
- {
- items.each(x => commit(x, database));
- to_be_deleted.each(x => database.apply(registry.prepare_command_for(x)));
- }
-
- public bool is_dirty()
- {
- return items.Count(x => x.has_changes()) > 0 || to_be_deleted.Count > 0;
- }
-
- public void Dispose()
- {
- items.Clear();
- }
-
- void commit(ITrackerEntry<T> entry, IDatabase database)
- {
- if (entry.has_changes()) database.apply(registry.prepare_command_for(entry.current));
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ChangeTrackerFactory.cs
@@ -1,23 +0,0 @@
-using System;
-using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class ChangeTrackerFactory : IChangeTrackerFactory
- {
- readonly IStatementRegistry statement_registry;
- readonly IDependencyRegistry registry;
-
- public ChangeTrackerFactory(IStatementRegistry statement_registry, IDependencyRegistry registry)
- {
- this.statement_registry = statement_registry;
- this.registry = registry;
- }
-
- public IChangeTracker<T> create_for<T>() where T : IIdentifiable<Guid>
- {
- return new ChangeTracker<T>(registry.get_a<ITrackerEntryMapper<T>>(), statement_registry);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ChangeTrackerFactorySpecs.cs
@@ -1,21 +0,0 @@
-using System;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class ChangeTrackerFactorySpecs
- {
- }
-
- [Concern(typeof (ChangeTrackerFactory))]
- public class when_creating_a_change_tracker_for_an_item : concerns_for<IChangeTrackerFactory, ChangeTrackerFactory>
- {
- it should_return_a_new_tracker = () => result.should_not_be_null();
-
- because b = () => { result = sut.create_for<IIdentifiable<Guid>>(); };
-
- static IChangeTracker<IIdentifiable<Guid>> result;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ChangeTrackerSpecs.cs
@@ -1,103 +0,0 @@
-using System;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class ChangeTrackerSpecs
- {
- }
-
- [Concern(typeof (ChangeTracker<IIdentifiable<Guid>>))]
- public abstract class behaves_like_change_tracker :
- concerns_for<IChangeTracker<IIdentifiable<Guid>>, ChangeTracker<IIdentifiable<Guid>>>
- {
- context c = () =>
- {
- mapper = the_dependency<ITrackerEntryMapper<IIdentifiable<Guid>>>();
- registry = the_dependency<IStatementRegistry>();
- };
-
- static protected ITrackerEntryMapper<IIdentifiable<Guid>> mapper;
- static protected IStatementRegistry registry;
- }
-
- [Concern(typeof (ChangeTracker<IIdentifiable<Guid>>))]
- public class when_commit_that_changes_made_to_an_item : behaves_like_change_tracker
- {
- it should_save_the_changes_to_the_database = () => database.was_told_to(x => x.apply(statement));
-
- context c = () =>
- {
- item = an<IIdentifiable<Guid>>();
- statement = an<IStatement>();
- database = an<IDatabase>();
- var entry = an<ITrackerEntry<IIdentifiable<Guid>>>();
-
- when_the(mapper).is_told_to(x => x.map_from(item)).it_will_return(entry);
- when_the(entry).is_told_to(x => x.has_changes()).it_will_return(true);
- when_the(entry).is_told_to(x => x.current).it_will_return(item);
- when_the(registry).is_told_to(x => x.prepare_command_for(item)).it_will_return(statement);
- };
-
- because b = () =>
- {
- sut.register(item);
- sut.commit_to(database);
- };
-
- static IIdentifiable<Guid> item;
- static IDatabase database;
- static IStatement statement;
- }
-
- [Concern(typeof (ChangeTracker<IIdentifiable<Guid>>))]
- public class when_checking_if_there_are_changes_and_there_are : behaves_like_change_tracker
- {
- it should_tell_the_truth = () => result.should_be_true();
-
- context c = () =>
- {
- item = an<IIdentifiable<Guid>>();
- var registration = an<ITrackerEntry<IIdentifiable<Guid>>>();
-
- when_the(mapper).is_told_to(x => x.map_from(item)).it_will_return(registration);
- when_the(registration).is_told_to(x => x.has_changes()).it_will_return(true);
- when_the(registration).is_told_to(x => x.current).it_will_return(item);
- };
-
- because b = () =>
- {
- sut.register(item);
- result = sut.is_dirty();
- };
-
- static bool result;
- static IIdentifiable<Guid> item;
- }
-
- [Concern(typeof (ChangeTracker<IIdentifiable<Guid>>))]
- public class when_checking_if_there_are_changes_and_there_are_not : behaves_like_change_tracker
- {
- it should_tell_the_truth = () => result.should_be_false();
-
- context c = () =>
- {
- item = an<IIdentifiable<Guid>>();
- var entry = an<ITrackerEntry<IIdentifiable<Guid>>>();
-
- when_the(mapper).is_told_to(x => x.map_from(item)).it_will_return(entry);
- when_the(entry).is_told_to(x => x.has_changes()).it_will_return(false);
- };
-
- because b = () =>
- {
- sut.register(item);
- result = sut.is_dirty();
- };
-
- static bool result;
- static IIdentifiable<Guid> item;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/Context.cs
@@ -1,34 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class Context : IContext
- {
- readonly IDictionary items;
-
- public Context(IDictionary items)
- {
- this.items = items;
- }
-
- public bool contains<T>(IKey<T> key)
- {
- return key.is_found_in(items);
- }
-
- public void add<T>(IKey<T> key, T value)
- {
- key.add_value_to(items, value);
- }
-
- public T value_for<T>(IKey<T> key)
- {
- return key.parse_from(items);
- }
-
- public void remove<T>(IKey<T> key)
- {
- key.remove_from(items);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ContextFactory.cs
@@ -1,15 +0,0 @@
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IContextFactory
- {
- IContext create_for(IScopedStorage storage);
- }
-
- public class ContextFactory : IContextFactory
- {
- public IContext create_for(IScopedStorage storage)
- {
- return new Context(storage.provide_storage());
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/ContextFactorySpecs.cs
@@ -1,33 +0,0 @@
-using System.Collections;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class ContextFactorySpecs
- {
- [Concern(typeof (ContextFactory))]
- public class when_creating_a_new_context : concerns_for<IContextFactory, ContextFactory>
- {
- context c = () =>
- {
- scope = an<IScopedStorage>();
- storage = an<IDictionary>();
-
- when_the(scope).is_told_to(x => x.provide_storage()).it_will_return(storage);
- };
-
- because b = () =>
- {
- result = sut.create_for(scope);
- };
-
- it should_return_a_context_that_represents_the_specified_scope =
- () => result.should_be_an_instance_of<Context>();
-
- static IDictionary storage;
- static IScopedStorage scope;
- static IContext result;
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/CurrentThread.cs
@@ -1,19 +0,0 @@
-using System.Threading;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class CurrentThread : IThread
- {
- public T provide_slot_for<T>() where T : class, new()
- {
- var slot = Thread.GetNamedDataSlot(create_key_for<T>());
- if (null == Thread.GetData(slot)) Thread.SetData(slot, new T());
- return (T) Thread.GetData(slot);
- }
-
- string create_key_for<T>()
- {
- return Thread.CurrentThread.ManagedThreadId + GetType().FullName + typeof (T).FullName;
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IChangeTracker.cs
@@ -1,17 +0,0 @@
-using System;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IChangeTracker : IDisposable
- {
- bool is_dirty();
- void commit_to(IDatabase database);
- }
-
- public interface IChangeTracker<T> : IChangeTracker where T : IIdentifiable<Guid>
- {
- void register(T value);
- void delete(T entity);
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IChangeTrackerFactory.cs
@@ -1,10 +0,0 @@
-using System;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IChangeTrackerFactory
- {
- IChangeTracker<T> create_for<T>() where T : IIdentifiable<Guid>;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IContext.cs
@@ -1,10 +0,0 @@
-namespace MoMoney.DataAccess.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
product/DataAccess/Transactions/IDatabase.cs
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IDatabase
- {
- IEnumerable<T> fetch_all<T>() where T : IIdentifiable<Guid>;
- void apply(IStatement statement);
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IDatabaseConnection.cs
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IDatabaseConnection : IDisposable
- {
- IEnumerable<T> query<T>();
- IEnumerable<T> query<T>(Predicate<T> predicate);
- void delete<T>(T entity);
- void commit();
- void store<T>(T entity);
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IdentityMapProxy.cs
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class IdentityMapProxy<Key, Value> : IIdentityMap<Key, Value> where Value : IIdentifiable<Guid>
- {
- readonly IIdentityMap<Key, Value> real_map;
- readonly IChangeTracker<Value> change_tracker;
-
- public IdentityMapProxy(IChangeTracker<Value> change_tracker, IIdentityMap<Key, Value> real_map)
- {
- this.change_tracker = change_tracker;
- this.real_map = real_map;
- }
-
- public IEnumerable<Value> all()
- {
- return real_map.all();
- }
-
- public void add(Key key, Value value)
- {
- change_tracker.register(value);
- real_map.add(key, value);
- }
-
- public void update_the_item_for(Key key, Value new_value)
- {
- real_map.update_the_item_for(key, new_value);
- }
-
- public bool contains_an_item_for(Key key)
- {
- return real_map.contains_an_item_for(key);
- }
-
- public Value item_that_belongs_to(Key key)
- {
- return real_map.item_that_belongs_to(key);
- }
-
- public void evict(Key key)
- {
- change_tracker.delete(real_map.item_that_belongs_to(key));
- real_map.evict(key);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IdentityMapSpecs.cs
@@ -1,95 +0,0 @@
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-
-namespace MoMoney.DataAccess.Transactions
-{
- [Concern(typeof (IdentityMap<,>))]
- public class behaves_like_identity_map : concerns_for<IIdentityMap<int, string>, IdentityMap<int, string>>
- {
- public override IIdentityMap<int, string> create_sut()
- {
- return new IdentityMap<int, string>();
- }
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_getting_an_item_from_the_identity_map_for_an_item_that_has_been_added : behaves_like_identity_map
- {
- it should_return_the_item_that_was_added_for_the_given_key = () => result.should_be_equal_to("1");
-
- because b = () =>
- {
- sut.add(1, "1");
- result = sut.item_that_belongs_to(1);
- };
-
- static string result;
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_getting_an_item_from_the_identity_map_that_has_not_been_added : behaves_like_identity_map
- {
- it should_return_the_default_value_for_that_type = () => result.should_be_equal_to(null);
-
- because b = () => { result = sut.item_that_belongs_to(2); };
-
- static string result;
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_checking_if_an_item_has_been_added_to_the_identity_map_that_has_been_added :
- behaves_like_identity_map
- {
- it should_return_true = () => result.should_be_true();
-
- because b = () =>
- {
- sut.add(10, "10");
- result = sut.contains_an_item_for(10);
- };
-
- static bool result;
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_checking_if_an_item_has_been_added_to_the_identity_map_that_has_not_been_added :
- behaves_like_identity_map
- {
- it should_return_false = () => result.should_be_false();
-
- because b = () => { result = sut.contains_an_item_for(9); };
-
- static bool result;
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_updating_the_value_for_a_key_that_has_already_been_added_to_the_identity_map :
- behaves_like_identity_map
- {
- it should_replace_the_old_item_with_the_new_one = () => result.should_be_equal_to("7");
-
- because b = () =>
- {
- sut.add(6, "6");
- sut.update_the_item_for(6, "7");
- result = sut.item_that_belongs_to(6);
- };
-
- static string result;
- }
-
- [Concern(typeof (IdentityMap<,>))]
- public class when_updating_the_value_for_a_key_that_has_not_been_added_to_the_identity_map :
- behaves_like_identity_map
- {
- it should_add_the_new_item = () => result.should_be_equal_to("3");
-
- because b = () =>
- {
- sut.update_the_item_for(3, "3");
- result = sut.item_that_belongs_to(3);
- };
-
- static string result;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IIdentityMap.cs
@@ -1,59 +0,0 @@
-using System.Collections.Generic;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IIdentityMap<TKey, TValue>
- {
- IEnumerable<TValue> all();
- void add(TKey key, TValue value);
- void update_the_item_for(TKey key, TValue new_value);
- bool contains_an_item_for(TKey key);
- TValue item_that_belongs_to(TKey key);
- void evict(TKey key);
- }
-
- public class IdentityMap<TKey, TValue> : IIdentityMap<TKey, TValue>
- {
- readonly IDictionary<TKey, TValue> items_in_map;
-
- public IdentityMap() : this(new Dictionary<TKey, TValue>())
- {
- }
-
- public IdentityMap(IDictionary<TKey, TValue> items_in_map)
- {
- this.items_in_map = items_in_map;
- }
-
- public IEnumerable<TValue> all()
- {
- return items_in_map.Values;
- }
-
- public void add(TKey key, TValue value)
- {
- items_in_map.Add(key, value);
- }
-
- public void update_the_item_for(TKey key, TValue new_value)
- {
- if (contains_an_item_for(key)) items_in_map[key] = new_value;
- else add(key, new_value);
- }
-
- public bool contains_an_item_for(TKey key)
- {
- return items_in_map.ContainsKey(key);
- }
-
- public TValue item_that_belongs_to(TKey key)
- {
- return contains_an_item_for(key) ? items_in_map[key] : default(TValue);
- }
-
- public void evict(TKey key)
- {
- if (contains_an_item_for(key)) items_in_map.Remove(key);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IKey.cs
@@ -1,12 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.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
product/DataAccess/Transactions/IScopedStorage.cs
@@ -1,9 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IScopedStorage
- {
- IDictionary provide_storage();
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IStatement.cs
@@ -1,7 +0,0 @@
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IStatement
- {
- void prepare(IDatabaseConnection connection);
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IStatementRegistry.cs
@@ -1,11 +0,0 @@
-using System;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IStatementRegistry
- {
- IStatement prepare_delete_statement_for<T>(T entity) where T : IIdentifiable<Guid>;
- IStatement prepare_command_for<T>(T entity) where T : IIdentifiable<Guid>;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/IThread.cs
@@ -1,7 +0,0 @@
-namespace MoMoney.DataAccess.Transactions
-{
- public interface IThread
- {
- T provide_slot_for<T>() where T : class, new();
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/PerThread.cs
@@ -1,58 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace MoMoney.DataAccess.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
product/DataAccess/Transactions/PerThreadScopedStorage.cs
@@ -1,19 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class PerThreadScopedStorage : IScopedStorage
- {
- readonly IThread current_thread;
-
- public PerThreadScopedStorage(IThread current_thread)
- {
- this.current_thread = current_thread;
- }
-
- public IDictionary provide_storage()
- {
- return current_thread.provide_slot_for<Hashtable>();
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/PerThreadScopedStorageSpecs.cs
@@ -1,32 +0,0 @@
-using System.Collections;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class PerThreadScopedStorageSpecs
- {
-
- [Concern(typeof (PerThreadScopedStorage))]
- public class when_retrieving_the_storage_for_a_specific_thread :
- concerns_for<IScopedStorage, PerThreadScopedStorage>
- {
- context c = () =>
- {
- thread = the_dependency<IThread>();
- storage = new Hashtable();
- when_the(thread)
- .is_told_to(x => x.provide_slot_for<Hashtable>())
- .it_will_return(storage);
- };
-
- because b = () => { result = sut.provide_storage(); };
-
- it should_return_the_storage_the_corresponds_to_the_current_thread = () => result.should_be_equal_to(storage);
-
- static IDictionary result;
- static IThread thread;
- static Hashtable storage;
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/Session.cs
@@ -1,104 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ISession : IDisposable
- {
- T find<T>(Guid guid) where T : IIdentifiable<Guid>;
- IEnumerable<T> all<T>() where T : IIdentifiable<Guid>;
- void save<T>(T entity) where T : IIdentifiable<Guid>;
- void delete<T>(T entity) where T : IIdentifiable<Guid>;
- void flush();
- bool is_dirty();
- }
-
- public class Session : ISession
- {
- 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>
- {
- if (get_identity_map_for<T>().contains_an_item_for(id))
- {
- return get_identity_map_for<T>().item_that_belongs_to(id);
- }
-
- var entity = database.fetch_all<T>().Single(x => x.id.Equals(id));
- get_identity_map_for<T>().add(id, entity);
- return entity;
- }
-
- public IEnumerable<T> all<T>() where T : IIdentifiable<Guid>
- {
- database
- .fetch_all<T>()
- .where(x => !get_identity_map_for<T>().contains_an_item_for(x.id))
- .each(x => get_identity_map_for<T>().add(x.id, x));
- return get_identity_map_for<T>().all();
- }
-
- 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);
- }
-
- public void delete<T>(T entity) where T : IIdentifiable<Guid>
- {
- get_identity_map_for<T>().evict(entity.id);
- }
-
- 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();
- }
-
- public void Dispose()
- {
- if (null != transaction) transaction.rollback_changes();
- }
-
- IIdentityMap<Guid, T> get_identity_map_for<T>() where T : IIdentifiable<Guid>
- {
- return identity_maps.ContainsKey(typeof (T))
- ? identity_maps[typeof (T)].downcast_to<IIdentityMap<Guid, T>>()
- : create_map_for<T>();
- }
-
- IIdentityMap<Guid, T> create_map_for<T>() where T : IIdentifiable<Guid>
- {
- var identity_map = transaction.create_for<T>();
- 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
product/DataAccess/Transactions/SessionFactory.cs
@@ -1,25 +0,0 @@
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ISessionFactory : IFactory<ISession>
- {
- }
-
- public class SessionFactory : ISessionFactory
- {
- readonly IDatabase database;
- readonly IChangeTrackerFactory factory;
-
- public SessionFactory(IDatabase database, IChangeTrackerFactory factory)
- {
- this.database = database;
- this.factory = factory;
- }
-
- public ISession create()
- {
- return new Session(new Transaction(database, factory), database);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/SessionFactorySpecs.cs
@@ -1,19 +0,0 @@
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class SessionFactorySpecs
- {
- }
-
- [Concern(typeof (SessionFactory))]
- public class when_creating_a_new_session : concerns_for<ISessionFactory, SessionFactory>
- {
- it should_return_a_new_session = () => result.should_not_be_null();
-
- because b = () => { result = sut.create(); };
-
- static ISession result;
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/SessionNotStartedException.cs
@@ -1,11 +0,0 @@
-using System;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class SessionNotStartedException : Exception
- {
- public SessionNotStartedException() : base("A session could not be found. Did you forget to open a session?")
- {
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/SessionProvider.cs
@@ -1,25 +0,0 @@
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ISessionProvider
- {
- ISession get_the_current_session();
- }
-
- public class SessionProvider : ISessionProvider
- {
- readonly IContext context;
- readonly IKey<ISession> session_key;
-
- public SessionProvider(IContext context, IKey<ISession> session_key)
- {
- this.context = context;
- this.session_key = session_key;
- }
-
- public ISession get_the_current_session()
- {
- if (!context.contains(session_key)) throw new SessionNotStartedException();
- return context.value_for(session_key);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/SessionSpecs.cs
@@ -1,181 +0,0 @@
-using System;
-using System.Collections.Generic;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class SessionSpecs
- {
- public class behaves_like_session : concerns_for<ISession, Session>
- {
- context c = () =>
- {
- transaction = the_dependency<ITransaction>();
- database = the_dependency<IDatabase>();
- };
-
- static protected ITransaction transaction;
- static protected IDatabase database;
- }
-
- [Concern(typeof (Session))]
- public class when_saving_a_transient_item_to_a_session : behaves_like_session
- {
- it should_add_the_entity_to_the_identity_map = () => map.was_told_to(x => x.add(guid, entity));
-
- context c = () =>
- {
- guid = Guid.NewGuid();
- entity = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
-
- when_the(entity).is_told_to(x => x.id).it_will_return(guid);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
- };
-
- because b = () => sut.save(entity);
-
- static ITestEntity entity;
- static IIdentityMap<Guid, ITestEntity> map;
- static Id<Guid> guid;
- }
-
- [Concern(typeof (Session))]
- public class when_commiting_the_changes_made_in_a_session : behaves_like_session
- {
- it should_commit_all_the_changes_from_the_running_transaction =
- () => transaction.was_told_to(x => x.commit_changes());
-
- it should_not_rollback_any_changes_from_the_running_transaction =
- () => transaction.was_not_told_to(x => x.rollback_changes());
-
- because b = () =>
- {
- sut.flush();
- sut.Dispose();
- };
- }
-
- [Concern(typeof (Session))]
- public class when_closing_a_session_before_flushing_the_changes : behaves_like_session
- {
- it should_rollback_any_changes_made_in_the_current_transaction =
- () => transaction.was_told_to(x => x.rollback_changes());
-
- because b = () => sut.Dispose();
- }
-
- [Concern(typeof (Session))]
- public class when_loading_all_instances_of_a_certain_type_and_some_have_already_been_loaded : behaves_like_session
- {
- it should_return_the_items_from_the_cache = () => results.should_contain(cached_item);
-
- it should_exclude_duplicates_from_the_database = () => results.should_not_contain(database_item);
-
- it should_add_items_from_the_database_to_the_identity_map =
- () => identity_map.was_told_to(x => x.add(id_of_the_uncached_item, uncached_item));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- id_of_the_uncached_item = Guid.NewGuid();
- identity_map = an<IIdentityMap<Guid, ITestEntity>>();
- cached_item = an<ITestEntity>();
- database_item = an<ITestEntity>();
- uncached_item = an<ITestEntity>();
-
- when_the(cached_item).is_told_to(x => x.id).it_will_return(id);
- when_the(database_item).is_told_to(x => x.id).it_will_return(id);
- when_the(uncached_item).is_told_to(x => x.id).it_will_return(id_of_the_uncached_item);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(identity_map);
- when_the(identity_map).is_told_to(x => x.contains_an_item_for(id)).it_will_return(true);
- when_the(identity_map).is_told_to(x => x.all()).it_will_return(cached_item);
- when_the(database).is_told_to(x => x.fetch_all<ITestEntity>())
- .it_will_return(database_item, uncached_item);
- };
-
- because b = () =>
- {
- sut.find<ITestEntity>(id);
- results = sut.all<ITestEntity>();
- };
-
- static IEnumerable<ITestEntity> results;
- static Id<Guid> id;
- static Id<Guid> id_of_the_uncached_item;
- static ITestEntity cached_item;
- static ITestEntity database_item;
- static IIdentityMap<Guid, ITestEntity> identity_map;
- static ITestEntity uncached_item;
- }
-
- [Concern(typeof (Session))]
- public class when_looking_up_a_specific_entity_by_its_id_and_it_has_not_been_loaded_into_the_cache :
- behaves_like_session
- {
- it should_return_that_item = () =>
- {
- result.should_be_equal_to(correct_item);
- };
-
- it should_add_that_item_to_the_identity_map = () => map.was_told_to(x => x.add(id, correct_item));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- wrong_item = an<ITestEntity>();
- correct_item = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
- when_the(wrong_item).is_told_to(x => x.id).it_will_return<Id<Guid>>(Guid.NewGuid());
- when_the(correct_item).is_told_to(x => x.id).it_will_return(id);
- when_the(database)
- .is_told_to(x => x.fetch_all<ITestEntity>())
- .it_will_return(wrong_item, correct_item);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>())
- .it_will_return(map);
- };
-
- because b = () =>
- {
- result = sut.find<ITestEntity>(id);
- };
-
- static Id<Guid> id;
- static IIdentifiable<Guid> result;
- static ITestEntity correct_item;
- static ITestEntity wrong_item;
- static IIdentityMap<Guid, ITestEntity> map;
- }
-
- [Concern(typeof (Session))]
- public class when_deleting_an_item_from_the_database : behaves_like_session
- {
- it should_remove_that_item_from_the_cache = () => map.was_told_to(x => x.evict(id));
-
- context c = () =>
- {
- id = Guid.NewGuid();
- entity = an<ITestEntity>();
- map = an<IIdentityMap<Guid, ITestEntity>>();
-
- when_the(entity).is_told_to(x => x.id).it_will_return(id);
- when_the(transaction).is_told_to(x => x.create_for<ITestEntity>()).it_will_return(map);
- when_the(database).is_told_to(x => x.fetch_all<ITestEntity>()).it_will_return(entity);
- };
-
- because b = () =>
- {
- sut.find<ITestEntity>(id);
- sut.delete(entity);
- };
-
- static Id<Guid> id;
- static IIdentityMap<Guid, ITestEntity> map;
- static ITestEntity entity;
- }
-
- public interface ITestEntity : IIdentifiable<Guid> {}
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/SingletonScopedStorage.cs
@@ -1,14 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class SingletonScopedStorage : IScopedStorage
- {
- static readonly IDictionary storage = new Hashtable();
-
- public IDictionary provide_storage()
- {
- return storage;
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/StatementRegistry.cs
@@ -1,48 +0,0 @@
-using System;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class StatementRegistry : IStatementRegistry
- {
- public IStatement prepare_delete_statement_for<T>(T entity) where T : IIdentifiable<Guid>
- {
- return new DeletionStatement<T>(entity);
- }
-
- public IStatement prepare_command_for<T>(T entity) where T : IIdentifiable<Guid>
- {
- return new SaveOrUpdateStatement<T>(entity);
- }
- }
-
- public class SaveOrUpdateStatement<T> : IStatement where T : IIdentifiable<Guid>
- {
- readonly T entity;
-
- public SaveOrUpdateStatement(T entity)
- {
- this.entity = entity;
- }
-
- public void prepare(IDatabaseConnection connection)
- {
- connection.store(entity);
- }
- }
-
- public class DeletionStatement<T> : IStatement
- {
- readonly T entity;
-
- public DeletionStatement(T entity)
- {
- this.entity = entity;
- }
-
- public void prepare(IDatabaseConnection connection)
- {
- connection.delete(entity);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/TrackerEntry.cs
@@ -1,47 +0,0 @@
-using System.Reflection;
-using Gorilla.Commons.Infrastructure.Logging;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ITrackerEntry<T>
- {
- T current { get; }
- bool has_changes();
- }
-
- public class TrackerEntry<T> : ITrackerEntry<T>
- {
- readonly T original;
-
- public TrackerEntry(T original, T current)
- {
- this.original = original;
- this.current = current;
- }
-
- public T current { get; set; }
-
- public bool has_changes()
- {
- this.log().debug("checking for changes");
- var type = original.GetType();
- foreach (var field in type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
- {
- var original_value = field.GetValue(original);
- var current_value = field.GetValue(current);
- if (original_value == null && current_value != null)
- {
- this.log().debug("{0} has changes: {1}", field, original);
- return true;
- }
- if (original_value != null && !original_value.Equals(current_value))
- {
- this.log().debug("{0} has changes: {1}", field, original);
- return true;
- }
- }
- this.log().debug("has no changes: {0}", original);
- return false;
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/TrackerEntryMapper.cs
@@ -1,29 +0,0 @@
-using Gorilla.Commons.Infrastructure.Cloning;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ITrackerEntryMapper<T> : IMapper<T, ITrackerEntry<T>>
- {
- }
-
- public class TrackerEntryMapper<T> : ITrackerEntryMapper<T>
- {
- readonly IPrototype prototype;
-
- public TrackerEntryMapper(IPrototype prototype)
- {
- this.prototype = prototype;
- }
-
- public ITrackerEntry<T> map_from(T item)
- {
- return new TrackerEntry<T>(create_prototype(item), item);
- }
-
- T create_prototype(T item)
- {
- return prototype.clone(item);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/TrackerEntrySpecs.cs
@@ -1,140 +0,0 @@
-using System;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class TrackerEntrySpecs
- {
- }
-
- public abstract class behaves_like_tracker_entry : concerns_for<ITrackerEntry<Pillow>>
- {
- }
-
- [Concern(typeof (ITrackerEntry<>))]
- public class when_comparing_the_current_instance_of_a_component_with_its_original_and_it_has_changes :
- behaves_like_tracker_entry
- {
- it should_indicate_that_there_are_changes = () => result.should_be_true();
-
- because b = () => { result = sut.has_changes(); };
-
- public override ITrackerEntry<Pillow> create_sut()
- {
- return new TrackerEntry<Pillow>(new Pillow("pink"), new Pillow("yellow"));
- }
-
- static bool result;
- }
-
- [Concern(typeof (ITrackerEntry<>))]
- public class when_the_original_instance_has_a_null_field_that_is_now_not_null :
- behaves_like_tracker_entry
- {
- it should_indicate_that_there_are_changes = () => result.should_be_true();
-
- because b = () => { result = sut.has_changes(); };
-
- public override ITrackerEntry<Pillow> create_sut()
- {
- return new TrackerEntry<Pillow>(new Pillow(null), new Pillow("yellow"));
- }
-
- static bool result;
- }
-
- [Concern(typeof (ITrackerEntry<>))]
- public class when_the_original_instance_had_a_non_null_field_and_the_current_instance_has_a_null_field :
- behaves_like_tracker_entry
- {
- it should_indicate_that_there_are_changes = () => result.should_be_true();
-
- because b = () => { result = sut.has_changes(); };
-
- context c = () =>
- {
- var id = Guid.NewGuid();
- original = new Pillow("green", id);
- current = new Pillow(null, id);
- };
-
- public override ITrackerEntry<Pillow> create_sut()
- {
- return new TrackerEntry<Pillow>(original, current);
- }
-
- static bool result;
- static Pillow original;
- static Pillow current;
- }
-
- [Concern(typeof (ITrackerEntry<>))]
- public class when_the_original_instance_has_the_same_value_as_the_current_instance :
- behaves_like_tracker_entry
- {
- it should_indicate_that_there_are_no_changes = () => result.should_be_false();
-
- because b = () => { result = sut.has_changes(); };
-
- context c = () =>
- {
- var id = Guid.NewGuid();
- original = new Pillow("green", id);
- current = new Pillow("green", id);
- };
-
- public override ITrackerEntry<Pillow> create_sut()
- {
- return new TrackerEntry<Pillow>(original, current);
- }
-
- static bool result;
- static Pillow original;
- static Pillow current;
- }
-
- public class Pillow : IIdentifiable<Guid>
- {
- readonly string color;
-
- public Pillow(string color) : this(color, Guid.NewGuid())
- {
- }
-
- public Pillow(string color, Guid id)
- {
- this.color = color;
- this.id = id;
- }
-
- public Id<Guid> id { get; set; }
-
- public bool Equals(Pillow other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return other.id.Equals(id);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != typeof (Pillow)) return false;
- return Equals((Pillow) obj);
- }
-
- public override int GetHashCode()
- {
- return id.GetHashCode();
- }
-
- public override string ToString()
- {
- return "{0} id: {1}".formatted_using(base.ToString(), id);
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/Transaction.cs
@@ -1,57 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public interface ITransaction
- {
- IIdentityMap<Guid, T> create_for<T>() where T : IIdentifiable<Guid>;
- void commit_changes();
- void rollback_changes();
- bool is_dirty();
- }
-
- public class Transaction : ITransaction
- {
- readonly IDatabase database;
- readonly IChangeTrackerFactory factory;
- readonly IDictionary<Type, IChangeTracker> change_trackers;
-
- public Transaction(IDatabase database, IChangeTrackerFactory factory)
- {
- this.factory = factory;
- this.database = database;
- change_trackers = new Dictionary<Type, IChangeTracker>();
- }
-
- public IIdentityMap<Guid, T> create_for<T>() where T : IIdentifiable<Guid>
- {
- return new IdentityMapProxy<Guid, T>(get_change_tracker_for<T>(), new IdentityMap<Guid, T>());
- }
-
- public void commit_changes()
- {
- change_trackers.Values.where(x => x.is_dirty()).each(x => x.commit_to(database));
- }
-
- public void rollback_changes()
- {
- change_trackers.each(x => x.Value.Dispose());
- change_trackers.Clear();
- }
-
- public bool is_dirty()
- {
- return change_trackers.Values.Count(x => x.is_dirty()) > 0;
- }
-
- IChangeTracker<T> get_change_tracker_for<T>() where T : IIdentifiable<Guid>
- {
- if (!change_trackers.ContainsKey(typeof (T))) change_trackers.Add(typeof (T), factory.create_for<T>());
- return change_trackers[typeof (T)].downcast_to<IChangeTracker<T>>();
- }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/TransactionSpecs.cs
@@ -1,113 +0,0 @@
-using System;
-using developwithpassion.bdd.contexts;
-using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class TransactionSpecs
- {
- }
-
- [Concern(typeof (Transaction))]
- public class behaves_like_transaction : concerns_for<ITransaction, Transaction>
- {
- context c = () =>
- {
- database = the_dependency<IDatabase>();
- factory = the_dependency<IChangeTrackerFactory>();
- };
-
- static protected IDatabase database;
- static protected IChangeTrackerFactory factory;
- }
-
- [Concern(typeof (Transaction))]
- public class when_creating_an_identity_map_for_a_specific_entity : behaves_like_transaction
- {
- it should_return_a_new_identity_map = () => result.should_not_be_null();
-
- because b = () => { result = sut.create_for<IIdentifiable<Guid>>(); };
-
- static IIdentityMap<Guid, IIdentifiable<Guid>> result;
- }
-
- [Concern(typeof (Transaction))]
- public class when_committing_a_transaction_and_an_item_in_the_identity_map_has_changed : behaves_like_transaction
- {
- it should_commit_the_changes_to_that_item =
- () => tracker.was_told_to(x => x.commit_to(database));
-
- context c = () =>
- {
- movie = new Movie("Goldeneye");
- tracker = an<IChangeTracker<IMovie>>();
-
- when_the(factory).is_told_to(x => x.create_for<IMovie>()).it_will_return(tracker);
- when_the(tracker).is_told_to(x => x.is_dirty()).it_will_return(true);
- };
-
-
- because b = () =>
- {
- sut.create_for<IMovie>().add(movie.id, movie);
- movie.change_name_to("Austin Powers");
- sut.commit_changes();
- };
-
- static IMovie movie;
- static IChangeTracker<IMovie> tracker;
- }
-
- [Concern(typeof (Transaction))]
- public class when_deleting_a_set_of_entities_from_the_database : behaves_like_transaction
- {
- it should_prepare_to_delete_that_item_form_the_database = () => tracker.was_told_to(x => x.delete(movie));
-
- it should_delete_all_items_marked_for_deletion = () => tracker.was_told_to(x => x.commit_to(database));
-
- context c = () =>
- {
- movie = new Movie("Goldeneye");
- tracker = an<IChangeTracker<IMovie>>();
-
- when_the(factory).is_told_to(x => x.create_for<IMovie>()).it_will_return(tracker);
- when_the(tracker).is_told_to(x => x.is_dirty()).it_will_return(true);
- };
-
- because b = () =>
- {
- var map = sut.create_for<IMovie>();
- map.add(movie.id, movie);
- map.evict(movie.id);
- sut.commit_changes();
- };
-
- static IMovie movie;
- static IChangeTracker<IMovie> tracker;
- }
-
- public interface IMovie : IIdentifiable<Guid>
- {
- string name { get; }
- void change_name_to(string name);
- }
-
- internal class Movie : IMovie
- {
- public Movie(string name)
- {
- id = Guid.NewGuid();
- this.name = name;
- }
-
- public string name { get; set; }
-
- public void change_name_to(string new_name)
- {
- name = new_name;
- }
-
- public Id<Guid> id { get; set; }
- }
-}
\ No newline at end of file
product/DataAccess/Transactions/TypedKey.cs
@@ -1,50 +0,0 @@
-using System.Collections;
-
-namespace MoMoney.DataAccess.Transactions
-{
- public class TypedKey<T> : IKey<T>
- {
- public bool is_found_in(IDictionary items)
- {
- return items.Contains(create_key());
- }
-
- public T parse_from(IDictionary items)
- {
- return (T) items[create_key()];
- }
-
- public void remove_from(IDictionary items)
- {
- if (is_found_in(items)) items.Remove(create_key());
- }
-
- public void add_value_to(IDictionary items, T value)
- {
- items[create_key()] = value;
- }
-
- public bool Equals(TypedKey<T> obj)
- {
- return !ReferenceEquals(null, obj);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != typeof (TypedKey<T>)) return false;
- return Equals((TypedKey<T>) obj);
- }
-
- public override int GetHashCode()
- {
- return GetType().GetHashCode();
- }
-
- string create_key()
- {
- return GetType().FullName;
- }
- }
-}
\ No newline at end of file
product/DataAccess/DataAccess.csproj
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{580E68A8-EDEE-4350-8BBE-A053645B0F83}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.DataAccess</RootNamespace>
- <AssemblyName>MoMoney.DataAccess</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="bdddoc, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\test\bdd.doc\bdddoc.dll</HintPath>
- </Reference>
- <Reference Include="Db4objects.Db4o, Version=7.5.57.11498, Culture=neutral, PublicKeyToken=6199cd4f203aa8eb, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\app\db40\Db4objects.Db4o.dll</HintPath>
- </Reference>
- <Reference Include="Db4objects.Db4o.Linq, Version=7.5.57.11498, Culture=neutral, PublicKeyToken=6199cd4f203aa8eb, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\app\db40\Db4objects.Db4o.Linq.dll</HintPath>
- </Reference>
- <Reference Include="developwithpassion.bdd, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\test\developwithpassion\developwithpassion.bdd.dll</HintPath>
- </Reference>
- <Reference Include="gorilla.commons.infrastructure, Version=2009.5.5.1633, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\app\gorilla\gorilla.commons.infrastructure.dll</HintPath>
- </Reference>
- <Reference Include="gorilla.commons.utility, Version=2009.5.5.1633, Culture=neutral, PublicKeyToken=687787ccb6c36c9f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\app\gorilla\gorilla.commons.utility.dll</HintPath>
- </Reference>
- <Reference Include="gorilla.testing, Version=2009.5.5.194, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\test\gorilla\gorilla.testing.dll</HintPath>
- </Reference>
- <Reference Include="MbUnit.Framework, Version=2.4.2.175, Culture=neutral, PublicKeyToken=5e72ecd30bc408d5">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\test\mbunit\MbUnit.Framework.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\test\rhino.mocks\Rhino.Mocks.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Db40\ConfigureObjectContainerStep.cs" />
- <Compile Include="Db40\Spiking\db40_spike_specs.cs" />
- <Compile Include="Repositories\AccountHolderRepository.cs" />
- <Compile Include="Repositories\BillRepository.cs" />
- <Compile Include="Repositories\CompanyRepository.cs" />
- <Compile Include="Repositories\IncomeRepository.cs" />
- <Compile Include="Db40\ConfigureDatabaseStep.cs" />
- <Compile Include="Db40\ConnectionFactory.cs" />
- <Compile Include="ObjectDatabase.cs" />
- <Compile Include="Db40\DatabaseConnection.cs" />
- <Compile Include="IConnectionFactory.cs" />
- <Compile Include="IDatabaseConfiguration.cs" />
- <Compile Include="Transactions\ChangeTracker.cs" />
- <Compile Include="Transactions\ChangeTrackerFactory.cs" />
- <Compile Include="Transactions\ChangeTrackerFactorySpecs.cs" />
- <Compile Include="Transactions\ChangeTrackerSpecs.cs" />
- <Compile Include="Transactions\Context.cs" />
- <Compile Include="Transactions\ContextFactory.cs" />
- <Compile Include="Transactions\ContextFactorySpecs.cs" />
- <Compile Include="Transactions\CurrentThread.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\IScopedStorage.cs" />
- <Compile Include="Transactions\IStatement.cs" />
- <Compile Include="Transactions\IStatementRegistry.cs" />
- <Compile Include="Transactions\IThread.cs" />
- <Compile Include="Transactions\PerThread.cs" />
- <Compile Include="Transactions\PerThreadScopedStorage.cs" />
- <Compile Include="Transactions\PerThreadScopedStorageSpecs.cs" />
- <Compile Include="Transactions\Session.cs" />
- <Compile Include="Transactions\SessionFactory.cs" />
- <Compile Include="Transactions\SessionFactorySpecs.cs" />
- <Compile Include="Transactions\SessionNotStartedException.cs" />
- <Compile Include="Transactions\SessionProvider.cs" />
- <Compile Include="Transactions\SessionSpecs.cs" />
- <Compile Include="Transactions\SingletonScopedStorage.cs" />
- <Compile Include="Transactions\StatementRegistry.cs" />
- <Compile Include="Transactions\TrackerEntry.cs" />
- <Compile Include="Transactions\TrackerEntryMapper.cs" />
- <Compile Include="Transactions\TrackerEntrySpecs.cs" />
- <Compile Include="Transactions\Transaction.cs" />
- <Compile Include="Transactions\TransactionSpecs.cs" />
- <Compile Include="Transactions\TypedKey.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Domain\Domain.csproj">
- <Project>{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}</Project>
- <Name>Domain</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </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.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
product/DataAccess/IConnectionFactory.cs
@@ -1,10 +0,0 @@
-using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.DataAccess.Transactions;
-
-namespace MoMoney.DataAccess
-{
- public interface IConnectionFactory
- {
- IDatabaseConnection open_connection_to(IFile the_path_to_the_database_file);
- }
-}
\ No newline at end of file
product/DataAccess/IDatabaseConfiguration.cs
@@ -1,11 +0,0 @@
-using Gorilla.Commons.Infrastructure.FileSystem;
-
-namespace MoMoney.DataAccess
-{
- public interface IDatabaseConfiguration
- {
- void open(IFile file);
- void copy_to(string path);
- void close(string name);
- }
-}
\ No newline at end of file
product/DataAccess/ObjectDatabase.cs
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Gorilla.Commons.Infrastructure.FileSystem;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.DataAccess.Transactions;
-
-namespace MoMoney.DataAccess
-{
- public class ObjectDatabase : IDatabase, IDatabaseConfiguration
- {
- readonly IConnectionFactory factory;
- IFile path;
-
- public ObjectDatabase(IConnectionFactory factory)
- {
- this.factory = factory;
- path = new ApplicationFile(Path.GetTempFileName());
- }
-
- public IEnumerable<T> fetch_all<T>() where T : IIdentifiable<Guid>
- {
- using (var connection = factory.open_connection_to(path_to_database()))
- {
- return connection.query<T>().ToList();
- }
- }
-
- public void apply(IStatement statement)
- {
- using (var connection = factory.open_connection_to(path_to_database()))
- {
- statement.prepare(connection);
- connection.commit();
- }
- }
-
- public void open(IFile file)
- {
- path = new ApplicationFile(Path.GetTempFileName());
- file.copy_to(path.path);
- }
-
- public void copy_to(string new_path)
- {
- path.copy_to(new_path);
- }
-
- public void close(string name)
- {
- path.delete();
- path = new ApplicationFile(Path.GetTempFileName());
- }
-
- IFile path_to_database()
- {
- return path;
- }
- }
-}
\ No newline at end of file
product/Domain/Accounting/AccountHolder.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Extensions;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.Core;
product/Domain/Accounting/AnnualIncomeVisitor.cs
@@ -1,10 +1,10 @@
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
using MoMoney.Domain.Core;
namespace MoMoney.Domain.Accounting
{
- public class AnnualIncomeVisitor : IValueReturningVisitor<Money, IIncome>
+ public class AnnualIncomeVisitor : ValueReturningVisitor<Money, IIncome>
{
readonly Year year;
product/Domain/Accounting/Bill.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Extensions;
using MoMoney.Domain.Core;
+using gorilla.commons.utility;
namespace MoMoney.Domain.Accounting
{
@@ -44,7 +44,7 @@ namespace MoMoney.Domain.Accounting
Money the_amount_paid()
{
- return payments.return_value_from_visiting_all_items_with(new TotalPaymentsCalculator());
+ return payments.return_value_from_visiting_all_with(new TotalPaymentsCalculator());
}
public bool Equals(Bill obj)
product/Domain/Accounting/CompanyFactory.cs
@@ -1,18 +1,16 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.repositories;
namespace MoMoney.Domain.Accounting
{
- public interface ICompanyFactory : IFactory<ICompany>
- {
- }
+ public interface ICompanyFactory : Factory<ICompany> {}
public class CompanyFactory : ICompanyFactory
{
- readonly IComponentFactory<Company> factory;
+ readonly ComponentFactory<Company> factory;
readonly ICompanyRepository companys;
- public CompanyFactory(IComponentFactory<Company> factory, ICompanyRepository companys)
+ public CompanyFactory(ComponentFactory<Company> factory, ICompanyRepository companys)
{
this.factory = factory;
this.companys = companys;
product/Domain/Accounting/GeneralLedger.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.Core;
@@ -14,7 +14,7 @@ namespace MoMoney.Domain.accounting
[Serializable]
public class GeneralLedger : IGeneralLedger
{
- private readonly List<ILedgerEntry> entries;
+ readonly List<ILedgerEntry> entries;
public GeneralLedger(List<ILedgerEntry> entries)
{
product/Domain/Accounting/IncomeExtensions.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Extensions;
using MoMoney.Domain.Core;
+using gorilla.commons.utility;
namespace MoMoney.Domain.Accounting
{
@@ -9,7 +9,7 @@ namespace MoMoney.Domain.Accounting
{
static public Money in_the(this IEnumerable<IIncome> income_collected, Year year)
{
- return income_collected.return_value_from_visiting_all_items_with(new AnnualIncomeVisitor(year));
+ return income_collected.return_value_from_visiting_all_with(new AnnualIncomeVisitor(year));
}
}
}
\ No newline at end of file
product/Domain/Accounting/TotalPaymentsCalculator.cs
@@ -1,9 +1,9 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.Core;
namespace MoMoney.Domain.Accounting
{
- internal class TotalPaymentsCalculator : IValueReturningVisitor<Money, IPayment>
+ class TotalPaymentsCalculator : ValueReturningVisitor<Money, IPayment>
{
public TotalPaymentsCalculator()
{
product/Domain/Core/Entity.cs
@@ -1,12 +1,9 @@
using System;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Domain.Core
{
- public interface IEntity : IIdentifiable<Guid>
- {
- }
+ public interface IEntity : Identifiable<Guid> {}
[Serializable]
public abstract class Entity<T> : IEntity where T : class, IEntity
product/Domain/Core/Money.cs
@@ -1,5 +1,5 @@
using System;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Domain.Core
{
@@ -9,9 +9,7 @@ namespace MoMoney.Domain.Core
readonly long dollars;
readonly int cents;
- public Money(long dollars) : this(dollars, 0)
- {
- }
+ public Money(long dollars) : this(dollars, 0) {}
public Money(long dollars, int cents)
{
@@ -59,12 +57,12 @@ namespace MoMoney.Domain.Core
}
}
- public static bool operator ==(Money left, Money right)
+ static public bool operator ==(Money left, Money right)
{
return Equals(left, right);
}
- public static bool operator !=(Money left, Money right)
+ static public bool operator !=(Money left, Money right)
{
return !Equals(left, right);
}
product/Domain/Core/MoneyExtensions.cs
@@ -1,10 +1,10 @@
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Domain.Core
{
- public static class MoneyExtensions
+ static public class MoneyExtensions
{
- public static Money as_money(this double amount)
+ static public Money as_money(this double amount)
{
var quotient = amount/0.01;
var wholePart = (int) quotient;
@@ -16,7 +16,7 @@ namespace MoMoney.Domain.Core
return new Money(cents/100, cents%100);
}
- public static Money as_money(this int amount)
+ static public Money as_money(this int amount)
{
var quotient = amount/0.01;
var wholePart = (int) quotient;
product/Domain/Domain.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.Domain</RootNamespace>
- <AssemblyName>MoMoney.Domain</AssemblyName>
+ <RootNamespace>momoney.domain</RootNamespace>
+ <AssemblyName>momoney.domain</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@@ -65,36 +65,36 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Accounting\AccountHolder.cs" />
- <Compile Include="Accounting\AccountHolderSpecs.cs" />
- <Compile Include="Accounting\Bill.cs" />
- <Compile Include="Accounting\BillingExtensions.cs" />
- <Compile Include="Accounting\BillSpecs.cs" />
- <Compile Include="Accounting\Company.cs" />
- <Compile Include="Accounting\CompanyFactory.cs" />
- <Compile Include="Accounting\ILedgerEntry.cs" />
- <Compile Include="Accounting\Income.cs" />
- <Compile Include="Accounting\Payment.cs" />
- <Compile Include="Accounting\TotalPaymentsCalculator.cs" />
- <Compile Include="Accounting\GeneralLedger.cs" />
- <Compile Include="Accounting\GeneralLedgerSpecs.cs" />
- <Compile Include="Accounting\AnnualIncomeVisitor.cs" />
- <Compile Include="Accounting\IncomeExtensions.cs" />
- <Compile Include="Core\Entity.cs" />
- <Compile Include="Core\Money.cs" />
- <Compile Include="Core\MoneyExtensions.cs" />
- <Compile Include="Core\MoneyExtensionsSpecs.cs" />
- <Compile Include="Core\MoneySpecs.cs" />
- <Compile Include="Core\Month.cs" />
- <Compile Include="Core\Months.cs" />
- <Compile Include="Core\range.cs" />
- <Compile Include="Core\RangeSpecs.cs" />
- <Compile Include="Core\Ranking.cs" />
- <Compile Include="Core\RankingSpecs.cs" />
- <Compile Include="Repositories\IAccountHolderRepository.cs" />
- <Compile Include="Repositories\IBillRepository.cs" />
- <Compile Include="Repositories\ICompanyRepository.cs" />
- <Compile Include="Repositories\IIncomeRepository.cs" />
+ <Compile Include="accounting\AccountHolder.cs" />
+ <Compile Include="accounting\AccountHolderSpecs.cs" />
+ <Compile Include="accounting\Bill.cs" />
+ <Compile Include="accounting\BillingExtensions.cs" />
+ <Compile Include="accounting\BillSpecs.cs" />
+ <Compile Include="accounting\Company.cs" />
+ <Compile Include="accounting\CompanyFactory.cs" />
+ <Compile Include="accounting\ILedgerEntry.cs" />
+ <Compile Include="accounting\Income.cs" />
+ <Compile Include="accounting\Payment.cs" />
+ <Compile Include="accounting\TotalPaymentsCalculator.cs" />
+ <Compile Include="accounting\GeneralLedger.cs" />
+ <Compile Include="accounting\GeneralLedgerSpecs.cs" />
+ <Compile Include="accounting\AnnualIncomeVisitor.cs" />
+ <Compile Include="accounting\IncomeExtensions.cs" />
+ <Compile Include="core\Entity.cs" />
+ <Compile Include="core\Money.cs" />
+ <Compile Include="core\MoneyExtensions.cs" />
+ <Compile Include="core\MoneyExtensionsSpecs.cs" />
+ <Compile Include="core\MoneySpecs.cs" />
+ <Compile Include="core\Month.cs" />
+ <Compile Include="core\Months.cs" />
+ <Compile Include="core\range.cs" />
+ <Compile Include="core\RangeSpecs.cs" />
+ <Compile Include="core\Ranking.cs" />
+ <Compile Include="core\RankingSpecs.cs" />
+ <Compile Include="repositories\IAccountHolderRepository.cs" />
+ <Compile Include="repositories\IBillRepository.cs" />
+ <Compile Include="repositories\ICompanyRepository.cs" />
+ <Compile Include="repositories\IIncomeRepository.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
product/DTO/DTO.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.DTO</RootNamespace>
- <AssemblyName>MoMoney.DTO</AssemblyName>
+ <RootNamespace>momoney.dto</RootNamespace>
+ <AssemblyName>momoney.dto</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
product/Presentation/Core/ApplicationController.cs
@@ -1,5 +1,4 @@
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Core
@@ -9,7 +8,7 @@ namespace MoMoney.Presentation.Core
void run<Presenter>() where Presenter : IPresenter;
}
- public class ApplicationController : IApplicationController, IParameterizedCommand<IPresenter>
+ public class ApplicationController : IApplicationController, ParameterizedCommand<IPresenter>
{
readonly IPresenterRegistry registered_presenters;
readonly IShell shell;
product/Presentation/Core/ApplicationControllerSpecs.cs
@@ -1,5 +1,6 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Core
product/Presentation/Core/ContentPresenter.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Core
{
product/Presentation/Core/IContentPresenter.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Core
{
product/Presentation/Core/IPresenter.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Core
{
- public interface IPresenter : ICommand
- {
- }
+ public interface IPresenter : Command {}
}
\ No newline at end of file
product/Presentation/Core/PresenterRegistry.cs
@@ -1,17 +1,16 @@
+using System.Collections;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Core
{
- public interface IPresenterRegistry : IRegistry<IPresenter>
- {
- }
+ public interface IPresenterRegistry : Registry<IPresenter> {}
public class PresenterRegistry : IPresenterRegistry
{
- readonly IRegistry<IPresenter> presenters;
+ readonly Registry<IPresenter> presenters;
- public PresenterRegistry(IRegistry<IPresenter> presenters)
+ public PresenterRegistry(Registry<IPresenter> presenters)
{
this.presenters = presenters;
}
@@ -20,5 +19,15 @@ namespace MoMoney.Presentation.Core
{
return presenters.all();
}
+
+ public IEnumerator<IPresenter> GetEnumerator()
+ {
+ return all().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
}
}
\ No newline at end of file
product/Presentation/Model/Excel/Cell.cs
@@ -1,21 +1,21 @@
using System;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Excel
{
public class Cell
{
- public static ISpecification<ICell> occurs_between_columns(int left_column, int right_column)
+ static public Specification<ICell> occurs_between_columns(int left_column, int right_column)
{
throw new NotImplementedException();
}
- public static ISpecification<ICell> occurs_after_row(int row_number)
+ static public Specification<ICell> occurs_after_row(int row_number)
{
throw new NotImplementedException();
}
- public static ISpecification<ICell> is_named(string name_of_the_cell)
+ static public Specification<ICell> is_named(string name_of_the_cell)
{
throw new NotImplementedException();
}
product/Presentation/Model/Excel/CompositeCellVisitor.cs
@@ -1,11 +1,11 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Excel
{
public class CompositeCellVisitor : ICellVisitor
{
- private readonly IList<ICellVisitor> all_visitors;
+ readonly IList<ICellVisitor> all_visitors;
public CompositeCellVisitor()
{
product/Presentation/Model/Excel/ConstrainedCellVisitor.cs
@@ -1,13 +1,13 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Excel
{
public class ConstrainedCellVisitor : ICellVisitor
{
- private readonly ICellVisitor cell_visitor;
- private readonly ISpecification<ICell> constraint;
+ readonly ICellVisitor cell_visitor;
+ readonly Specification<ICell> constraint;
- public ConstrainedCellVisitor(ICellVisitor cell_visitor, ISpecification<ICell> constraint)
+ public ConstrainedCellVisitor(ICellVisitor cell_visitor, Specification<ICell> constraint)
{
this.cell_visitor = cell_visitor;
this.constraint = constraint;
product/Presentation/Model/Excel/ExcelUsage.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Excel
{
product/Presentation/Model/Excel/ICellVisitor.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Excel
{
- public interface ICellVisitor : IVisitor<ICell>
- {
- }
+ public interface ICellVisitor : Visitor<ICell> {}
}
\ No newline at end of file
product/Presentation/Model/Menu/File/CloseProjectCommand.cs
@@ -1,10 +1,11 @@
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface ICloseCommand : ICommand, ISaveChangesCallback, ILoggable
+ public interface ICloseCommand : Command, ISaveChangesCallback, Loggable
{
}
product/Presentation/Model/Menu/File/CloseWindowCommand.cs
@@ -1,11 +1,9 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface ICloseWindowCommand : ICommand
- {
- }
+ public interface ICloseWindowCommand : Command {}
public class CloseWindowCommand : ICloseWindowCommand
{
product/Presentation/Model/Menu/File/ExitCommand.cs
@@ -1,11 +1,12 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface IExitCommand : ICommand, ISaveChangesCallback
+ public interface IExitCommand : Command, ISaveChangesCallback
{
}
product/Presentation/Model/Menu/File/ExitCommandSpecs.cs
@@ -1,10 +1,11 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
[Concern(typeof (ExitCommand))]
public abstract class behaves_like_exit_command : concerns_for<IExitCommand>
product/Presentation/Model/Menu/File/FileMenu.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using momoney.presentation.model.menu.file;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Winforms.Keyboard;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Model/Menu/File/NewCommand.cs
@@ -1,9 +1,10 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface INewCommand : ICommand, ISaveChangesCallback
+ public interface INewCommand : Command, ISaveChangesCallback
{
}
product/Presentation/Model/Menu/File/NewCommandSpecs.cs
@@ -1,8 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
[Concern(typeof (NewCommand))]
public abstract class behaves_like_new_command : concerns_for<INewCommand, NewCommand>
product/Presentation/Model/Menu/File/OpenCommand.cs
@@ -1,10 +1,11 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface IOpenCommand : ICommand, ISaveChangesCallback
+ public interface IOpenCommand : Command, ISaveChangesCallback
{
}
product/Presentation/Model/Menu/File/OpenCommandSpecs.cs
@@ -1,10 +1,11 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Testing;
+using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
[Concern(typeof (OpenCommand))]
public abstract class behaves_like_command_to_open_a_project : concerns_for<IOpenCommand, OpenCommand>
product/Presentation/Model/Menu/File/SaveAsCommand.cs
@@ -1,12 +1,10 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface ISaveAsCommand : ICommand
- {
- }
+ public interface ISaveAsCommand : Command {}
public class SaveAsCommand : ISaveAsCommand
{
product/Presentation/Model/Menu/File/SaveAsCommandSpecs.cs
@@ -2,9 +2,9 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
[Concern(typeof (SaveAsCommand))]
public class when_saving_the_current_project_to_a_new_file_path : concerns_for<ISaveAsCommand, SaveAsCommand>
product/Presentation/Model/Menu/File/SaveChangesCommand.cs
@@ -1,14 +1,13 @@
using System;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
+using momoney.presentation.model.menu.file;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Model.Menu.File
{
- public interface ISaveChangesCommand : IParameterizedCommand<ISaveChangesCallback>
- {
- }
+ public interface ISaveChangesCommand : ParameterizedCommand<ISaveChangesCallback> {}
public interface ISaveChangesPresenter : IPresenter
{
product/Presentation/Model/Menu/File/SaveCommand.cs
@@ -1,11 +1,9 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
- public interface ISaveCommand : ICommand
- {
- }
+ public interface ISaveCommand : Command {}
public class SaveCommand : ISaveCommand
{
product/Presentation/Model/Menu/File/SaveCommandSpecs.cs
@@ -2,7 +2,7 @@ using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.Presentation.Model.Projects;
-namespace MoMoney.Presentation.Model.Menu.File
+namespace momoney.presentation.model.menu.file
{
[Concern(typeof (SaveCommand))]
public abstract class behaves_like_the_save_command : concerns_for<ISaveCommand, SaveCommand>
product/Presentation/Model/Menu/Help/display_information_about_the_application.cs
@@ -1,24 +0,0 @@
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Presentation.Presenters;
-
-namespace MoMoney.Presentation.Model.Menu.Help
-{
- public interface IDisplayInformationAboutTheApplication : ICommand
- {
- }
-
- public class display_information_about_the_application : IDisplayInformationAboutTheApplication
- {
- public display_information_about_the_application(IRunPresenterCommand run_presenter)
- {
- this.run_presenter = run_presenter;
- }
-
- public void run()
- {
- run_presenter.run<IAboutApplicationPresenter>();
- }
-
- readonly IRunPresenterCommand run_presenter;
- }
-}
\ No newline at end of file
product/Presentation/Model/Menu/Help/HelpMenu.cs
@@ -1,4 +1,6 @@
using System.Collections.Generic;
+using MoMoney.Presentation.model.menu.help;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Model/Menu/Window/WindowMenu.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoMoney.Presentation.Model.Menu.File;
+using momoney.presentation.model.menu.file;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Model.Menu.window
product/Presentation/Model/Menu/IToolbarItemBuilder.cs
@@ -1,5 +1,5 @@
using System;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Model.Menu
@@ -7,7 +7,7 @@ namespace MoMoney.Presentation.Model.Menu
public interface IToolbarItemBuilder
{
IToolbarItemBuilder with_tool_tip_text_as(string text);
- IToolbarItemBuilder when_clicked_executes<T>() where T : ICommand;
+ IToolbarItemBuilder when_clicked_executes<T>() where T : Command;
IToolbarItemBuilder displays_icon(HybridIcon project);
IToolbarItemBuilder can_be_clicked_when(Func<bool> condition);
IToolbarButton button();
product/Presentation/Model/Menu/MenuItemBuilder.cs
@@ -1,6 +1,6 @@
using System;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Winforms.Keyboard;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
@@ -8,10 +8,10 @@ using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Model.Menu
{
- public interface IMenuItemBuilder : IBuilder<IMenuItem>
+ public interface IMenuItemBuilder : Builder<IMenuItem>
{
IMenuItemBuilder named(string name);
- IMenuItemBuilder that_executes<TheCommand>() where TheCommand : ICommand;
+ IMenuItemBuilder that_executes<TheCommand>() where TheCommand : Command;
IMenuItemBuilder that_executes(Action action);
IMenuItemBuilder represented_by(HybridIcon project);
IMenuItemBuilder can_be_accessed_with(ShortcutKey hot_key);
@@ -20,7 +20,7 @@ namespace MoMoney.Presentation.Model.Menu
public class MenuItemBuilder : IMenuItemBuilder
{
- readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
readonly IEventAggregator aggregator;
readonly ICommandProcessor processor;
@@ -30,10 +30,10 @@ namespace MoMoney.Presentation.Model.Menu
ShortcutKey key { get; set; }
Func<bool> can_be_clicked = () => true;
- public MenuItemBuilder(IDependencyRegistry registry, IEventAggregator aggregator, ICommandProcessor processor)
+ public MenuItemBuilder(DependencyRegistry registry, IEventAggregator aggregator, ICommandProcessor processor)
{
name_of_the_menu = "Unknown";
- command_to_execute = () => { };
+ command_to_execute = () => {};
this.registry = registry;
this.processor = processor;
this.aggregator = aggregator;
@@ -47,9 +47,9 @@ namespace MoMoney.Presentation.Model.Menu
return this;
}
- public IMenuItemBuilder that_executes<TheCommand>() where TheCommand : ICommand
+ public IMenuItemBuilder that_executes<TheCommand>() where TheCommand : Command
{
- command_to_execute = () => processor.add( registry.get_a<TheCommand>());
+ command_to_execute = () => processor.add(registry.get_a<TheCommand>());
return this;
}
product/Presentation/Model/Menu/SubMenu.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Menu
{
product/Presentation/Model/Menu/SubMenuRegistry.cs
@@ -1,14 +1,13 @@
+using System.Collections;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Menu.Help;
using MoMoney.Presentation.Model.Menu.window;
namespace MoMoney.Presentation.Model.Menu
{
- public interface ISubMenuRegistry : IRegistry<ISubMenu>
- {
- }
+ public interface ISubMenuRegistry : Registry<ISubMenu> {}
public class SubMenuRegistry : ISubMenuRegistry
{
@@ -29,5 +28,15 @@ namespace MoMoney.Presentation.Model.Menu
yield return window_menu;
yield return help_menu;
}
+
+ public IEnumerator<ISubMenu> GetEnumerator()
+ {
+ return all().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
}
}
\ No newline at end of file
product/Presentation/Model/Menu/ToolBarItemBuilder.cs
@@ -1,7 +1,6 @@
using System;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
using MoMoney.Service.Infrastructure.Threading;
@@ -10,12 +9,12 @@ namespace MoMoney.Presentation.Model.Menu
{
public class ToolBarItemBuilder : IToolbarItemBuilder, IToolbarButton
{
- readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
readonly ToolStripButton item;
readonly ICommandProcessor processor;
Func<bool> the_condition;
- public ToolBarItemBuilder(IDependencyRegistry registry, IEventAggregator aggregator, ICommandProcessor processor)
+ public ToolBarItemBuilder(DependencyRegistry registry, IEventAggregator aggregator, ICommandProcessor processor)
{
this.registry = registry;
this.processor = processor;
@@ -30,7 +29,7 @@ namespace MoMoney.Presentation.Model.Menu
return this;
}
- public IToolbarItemBuilder when_clicked_executes<Command>() where Command : ICommand
+ public IToolbarItemBuilder when_clicked_executes<Command>() where Command : gorilla.commons.utility.Command
{
item.Click += (sender, args) => processor.add(registry.get_a<Command>());
return this;
product/Presentation/Model/Projects/IProject.cs
@@ -1,8 +1,8 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.Projects
{
- public interface IProject : IState
+ public interface IProject : State
{
string name();
bool is_file_specified();
product/Presentation/Model/Projects/IProjectController.cs
@@ -6,9 +6,9 @@ namespace MoMoney.Presentation.Model.Projects
{
string name();
void start_new_project();
- void open_project_from(IFile file);
+ void open_project_from(File file);
void save_changes();
- void save_project_to(IFile new_file);
+ void save_project_to(File new_file);
void close_project();
bool has_been_saved_at_least_once();
bool has_unsaved_changes();
product/Presentation/Model/Projects/Project.cs
@@ -4,9 +4,9 @@ namespace MoMoney.Presentation.Model.Projects
{
public class Project : IProject
{
- readonly IFile file;
+ readonly File file;
- public Project(IFile file)
+ public Project(File file)
{
this.file = file;
}
product/Presentation/Model/Projects/ProjectController.cs
@@ -1,15 +1,14 @@
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Model.messages;
+using gorilla.commons.utility;
+using momoney.presentation.model.events;
using MoMoney.Service.Contracts.Infrastructure;
-using MoMoney.Service.Contracts.Infrastructure.Transactions;
+using momoney.service.contracts.infrastructure.transactions;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Presentation.Model.Projects
{
- public class ProjectController : IProjectController, ICallback<IUnitOfWork>
+ public class ProjectController : IProjectController, Callback<IUnitOfWork>
{
readonly IEventAggregator broker;
readonly IProjectTasks configuration;
@@ -36,7 +35,7 @@ namespace MoMoney.Presentation.Model.Projects
broker.publish(new NewProjectOpened(name()));
}
- public void open_project_from(IFile file)
+ public void open_project_from(File file)
{
if (!file.does_the_file_exist()) return;
close_project();
@@ -53,7 +52,7 @@ namespace MoMoney.Presentation.Model.Projects
broker.publish<SavedChangesEvent>();
}
- public void save_project_to(IFile new_file)
+ public void save_project_to(File new_file)
{
if (new_file.path.is_blank()) return;
project = new Project(new_file);
product/Presentation/Model/Projects/ProjectControllerSpecs.cs
@@ -2,26 +2,24 @@ using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.FileSystem;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Model.messages;
+using gorilla.commons.utility;
+using momoney.presentation.model.events;
using MoMoney.Service.Contracts.Infrastructure;
-using MoMoney.Service.Contracts.Infrastructure.Transactions;
+using momoney.service.contracts.infrastructure.transactions;
using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Presentation.Model.Projects
{
- public class ProjectControllerSpecs
- {
- }
+ public class ProjectControllerSpecs {}
[Concern(typeof (ProjectController))]
public abstract class behaves_like_a_project : concerns_for<IProjectController, ProjectController>
{
context c = () =>
- {
- broker = the_dependency<IEventAggregator>();
- tasks = the_dependency<IProjectTasks>();
- };
+ {
+ broker = the_dependency<IEventAggregator>();
+ tasks = the_dependency<IProjectTasks>();
+ };
static protected IEventAggregator broker;
static protected IProjectTasks tasks;
@@ -32,18 +30,18 @@ namespace MoMoney.Presentation.Model.Projects
it should_notify_the_rest_of_the_application = () => broker.was_told_to(x => x.publish<SavedChangesEvent>());
context c = () =>
- {
- file_to_update = an<IFile>();
- when_the(file_to_update).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
- };
+ {
+ file_to_update = an<File>();
+ when_the(file_to_update).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
+ };
because b = () =>
- {
- sut.open_project_from(file_to_update);
- sut.save_changes();
- };
+ {
+ sut.open_project_from(file_to_update);
+ sut.save_changes();
+ };
- static IFile file_to_update;
+ static File file_to_update;
}
public class when_attempting_to_save_the_changes_to_a_project_and_a_file_to_save_to_has_not_been_specified :
@@ -51,7 +49,10 @@ namespace MoMoney.Presentation.Model.Projects
{
it should_inform_the_user_of_an_error = () => the_call.should_have_thrown<FileNotSpecifiedException>();
- because b = () => { the_call = call.to(() => sut.save_changes()); };
+ because b = () =>
+ {
+ the_call = call.to(() => sut.save_changes());
+ };
static Action the_call;
}
@@ -61,20 +62,20 @@ namespace MoMoney.Presentation.Model.Projects
it should_save_the_current_database_to_the_new_path = () => tasks.was_told_to(x => x.copy_to("blah"));
context c = () =>
- {
- original_file = an<IFile>();
- new_file = an<IFile>();
- when_the(new_file).is_told_to(x => x.path).it_will_return("blah");
- };
+ {
+ original_file = an<File>();
+ new_file = an<File>();
+ when_the(new_file).is_told_to(x => x.path).it_will_return("blah");
+ };
because b = () =>
- {
- sut.open_project_from(original_file);
- sut.save_project_to(new_file);
- };
+ {
+ sut.open_project_from(original_file);
+ sut.save_project_to(new_file);
+ };
- static IFile original_file;
- static IFile new_file;
+ static File original_file;
+ static File new_file;
}
public class when_attempting_to_open_an_invalid_project_file_path : behaves_like_a_project
@@ -82,18 +83,18 @@ namespace MoMoney.Presentation.Model.Projects
it should_not_change_the_current_working_file = () => result.should_be_equal_to(false);
context c = () =>
- {
- invalid_file = an<IFile>();
- when_the(invalid_file).is_told_to(x => x.does_the_file_exist()).it_will_return(false);
- };
+ {
+ invalid_file = an<File>();
+ when_the(invalid_file).is_told_to(x => x.does_the_file_exist()).it_will_return(false);
+ };
because b = () =>
- {
- sut.open_project_from(invalid_file);
- result = sut.has_been_saved_at_least_once();
- };
+ {
+ sut.open_project_from(invalid_file);
+ result = sut.has_been_saved_at_least_once();
+ };
- static IFile invalid_file;
+ static File invalid_file;
static bool result;
}
@@ -102,40 +103,43 @@ namespace MoMoney.Presentation.Model.Projects
it should_not_change_the_current_file_to_the_invalid_one = () => result.should_be_equal_to(false);
context c = () =>
- {
- invalid_file = an<IFile>();
+ {
+ invalid_file = an<File>();
- when_the(invalid_file).is_told_to(x => x.path).it_will_return(string.Empty);
- };
+ when_the(invalid_file).is_told_to(x => x.path).it_will_return(string.Empty);
+ };
because b = () =>
- {
- sut.save_project_to(invalid_file);
- result = sut.has_been_saved_at_least_once();
- };
+ {
+ sut.save_project_to(invalid_file);
+ result = sut.has_been_saved_at_least_once();
+ };
- static IFile invalid_file;
+ static File invalid_file;
static bool result;
}
public class when_opening_a_new_file : behaves_like_a_project
{
context c = () =>
- {
- file = an<IFile>();
- when_the(file).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
- };
+ {
+ file = an<File>();
+ when_the(file).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
+ };
because b = () => sut.open_project_from(file);
- static IFile file;
+ static File file;
}
public class when_checking_if_there_are_any_unsaved_changes_and_a_project_is_not_open : behaves_like_a_project
{
it should_return_false = () => result.should_be_equal_to(false);
- because b = () => { result = sut.has_unsaved_changes(); };
+ because b = () =>
+ {
+ result = sut.has_unsaved_changes();
+ };
static bool result;
}
@@ -145,16 +149,16 @@ namespace MoMoney.Presentation.Model.Projects
it should_return_true = () => result.should_be_true();
context c = () =>
- {
- unit_of_work = an<IUnitOfWork>();
- when_the(unit_of_work).is_told_to(x => x.is_dirty()).it_will_return(true);
- };
+ {
+ unit_of_work = an<IUnitOfWork>();
+ when_the(unit_of_work).is_told_to(x => x.is_dirty()).it_will_return(true);
+ };
because b = () =>
- {
- sut.downcast_to<ProjectController>().run(unit_of_work);
- result = sut.has_unsaved_changes();
- };
+ {
+ sut.downcast_to<ProjectController>().run(unit_of_work);
+ result = sut.has_unsaved_changes();
+ };
static bool result;
static IUnitOfWork unit_of_work;
@@ -165,10 +169,10 @@ namespace MoMoney.Presentation.Model.Projects
it should_close_the_previous_project = () => broker.was_told_to(x => x.publish<ClosingProjectEvent>());
because b = () =>
- {
- sut.start_new_project();
- sut.start_new_project();
- };
+ {
+ sut.start_new_project();
+ sut.start_new_project();
+ };
}
public class when_opening_an_existing_project_and_a_project_was_already_open : behaves_like_a_project
@@ -176,17 +180,17 @@ namespace MoMoney.Presentation.Model.Projects
it should_close_the_previous_project = () => broker.was_told_to(x => x.publish<ClosingProjectEvent>());
context c = () =>
- {
- file = an<IFile>();
- when_the(file).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
- };
+ {
+ file = an<File>();
+ when_the(file).is_told_to(x => x.does_the_file_exist()).it_will_return(true);
+ };
because b = () =>
- {
- sut.open_project_from(file);
- sut.start_new_project();
- };
+ {
+ sut.open_project_from(file);
+ sut.start_new_project();
+ };
- static IFile file;
+ static File file;
}
}
\ No newline at end of file
product/Presentation/Model/Reporting/IBindReportTo.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.reporting
{
- public interface IBindReportTo<T, Query> : IReport, IParameterizedCommand<T> where Query : IQuery<T>
- {
- }
+ public interface IBindReportTo<T, Query> : IReport, ParameterizedCommand<T> where Query : Query<T> {}
}
\ No newline at end of file
product/Presentation/Model/Reporting/ReportBindingExtensions.cs
@@ -1,18 +1,20 @@
using System;
using System.Linq.Expressions;
using DataDynamics.ActiveReports;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Model.reporting
{
- public static class ReportBindingExtensions
+ static public class ReportBindingExtensions
{
- public static void bind_to<T, K>(this ARControl control, Expression<Func<T, K>> func)
+ static public void bind_to<T, K>(this ARControl control, Expression<Func<T, K>> func)
{
- if (func.Body.is_an_implementation_of<MemberExpression>()) {
+ if (func.Body.is_an_implementation_of<MemberExpression>())
+ {
control.DataField = func.Body.downcast_to<MemberExpression>().Member.Name;
}
- else {
+ else
+ {
control.DataField = func.Body.downcast_to<UnaryExpression>().Method.Name;
}
}
product/Presentation/Presenters/AboutTheApplicationPresenter.cs
@@ -1,7 +1,7 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IAboutApplicationPresenter : IContentPresenter
{
product/Presentation/Presenters/AddBillingTaskPane.cs
@@ -1,3 +1,4 @@
+using momoney.presentation.presenters;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddBillPaymentPresenter.cs
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views;
+using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IAddBillPaymentPresenter : IContentPresenter
{
product/Presentation/Presenters/AddCompanyTaskPane.cs
@@ -1,3 +1,4 @@
+using momoney.presentation.presenters;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddIncomeTaskPane.cs
@@ -1,3 +1,4 @@
+using momoney.presentation.presenters;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
product/Presentation/Presenters/AddNewIncomePresenterSpecs.cs
@@ -2,10 +2,11 @@ using System.Collections.Generic;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
using MoMoney.DTO;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
[Concern(typeof (AddNewIncomePresenter))]
public abstract class behaves_like_add_new_income_presenter :
product/Presentation/Presenters/AddReportingTaskPane.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using MoMoney.DTO;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Contracts.Application;
product/Presentation/Presenters/ApplicationMenuPresenter.cs
@@ -1,14 +1,12 @@
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IApplicationMenuPresenter : IPresenter
- {
- }
+ public interface IApplicationMenuPresenter : IPresenter {}
public class ApplicationMenuPresenter : IApplicationMenuPresenter
{
product/Presentation/Presenters/ApplicationShellPresenter.cs
@@ -1,10 +1,10 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.Menu.File;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
+using momoney.presentation.model.menu.file;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IApplicationShellPresenter : IPresenter, IEventSubscriber<ClosingProjectEvent>
{
product/Presentation/Presenters/Build.cs
@@ -1,4 +1,6 @@
-namespace MoMoney.Presentation.Presenters
+using MoMoney.Presentation.Presenters;
+
+namespace momoney.presentation.presenters
{
public class Build
{
product/Presentation/Presenters/CheckForUpdatesPresenter.cs
@@ -1,14 +1,16 @@
using Gorilla.Commons.Infrastructure.Logging;
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views;
+using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
+using momoney.service.contracts.infrastructure.updating;
using MoMoney.Service.Contracts.Infrastructure.Updating;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface ICheckForUpdatesPresenter : IPresenter, ICallback<Percent>
+ public interface ICheckForUpdatesPresenter : IPresenter, Callback<Percent>
{
void begin_update();
void cancel_update();
@@ -36,7 +38,7 @@ namespace MoMoney.Presentation.Presenters
public void begin_update()
{
- pump.run<IDownloadTheLatestVersion, ICallback<Percent>>(this);
+ pump.run<IDownloadTheLatestVersion, Callback<Percent>>(this);
}
public void cancel_update()
product/Presentation/Presenters/CheckForUpdatesPresenterSpecs.cs
@@ -1,12 +1,14 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Views;
+using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
+using momoney.service.contracts.infrastructure.updating;
using MoMoney.Service.Contracts.Infrastructure.Updating;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
[Concern(typeof (CheckForUpdatesPresenter))]
public abstract class behaves_like_check_for_updates_presenter :
@@ -38,7 +40,7 @@ namespace MoMoney.Presentation.Presenters
public class when_initiating_an_update_and_one_is_available : behaves_like_check_for_updates_presenter
{
it should_start_downloading_the_latest_version_of_the_application =
- () => pump.was_told_to(x => x.run<IDownloadTheLatestVersion, ICallback<Percent>>(sut));
+ () => pump.was_told_to(x => x.run<IDownloadTheLatestVersion, Callback<Percent>>(sut));
because b = () => sut.begin_update();
}
product/Presentation/Presenters/CommandFactory.cs
@@ -1,11 +1,12 @@
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Threading;
+using gorilla.commons.utility;
+using momoney.presentation.presenters;
+using momoney.service.infrastructure.threading;
namespace MoMoney.Presentation.Presenters
{
public interface ICommandFactory
{
- ICommand create_for<T>(ICallback<T> item, IQuery<T> query);
+ Command create_for<T>(Callback<T> item, Query<T> query);
}
public class CommandFactory : ICommandFactory
@@ -17,7 +18,7 @@ namespace MoMoney.Presentation.Presenters
this.factory = factory;
}
- public ICommand create_for<T>(ICallback<T> item, IQuery<T> query)
+ public Command create_for<T>(Callback<T> item, Query<T> query)
{
return new RunQueryCommand<T>(item, new ProcessQueryCommand<T>(query, factory));
}
product/Presentation/Presenters/CommandPump.cs
@@ -1,54 +1,54 @@
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Presenters
{
public interface ICommandPump
{
- ICommandPump run<Command>() where Command : ICommand;
- ICommandPump run<Command>(Command command) where Command : ICommand;
- ICommandPump run<Command, T>(T input) where Command : IParameterizedCommand<T>;
- ICommandPump run<T>(ICallback<T> item, IQuery<T> query);
- ICommandPump run<Output, Query>(ICallback<Output> item) where Query : IQuery<Output>;
+ ICommandPump run<Command>() where Command : gorilla.commons.utility.Command;
+ ICommandPump run<Command>(Command command) where Command : gorilla.commons.utility.Command;
+ ICommandPump run<Command, T>(T input) where Command : ParameterizedCommand<T>;
+ ICommandPump run<T>(Callback<T> item, Query<T> query);
+ ICommandPump run<Output, Query>(Callback<Output> item) where Query : Query<Output>;
}
public class CommandPump : ICommandPump
{
readonly ICommandProcessor processor;
- readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
readonly ICommandFactory factory;
- public CommandPump(ICommandProcessor processor, IDependencyRegistry registry, ICommandFactory factory)
+ public CommandPump(ICommandProcessor processor, DependencyRegistry registry, ICommandFactory factory)
{
this.processor = processor;
this.factory = factory;
this.registry = registry;
}
- public ICommandPump run<Command>() where Command : ICommand
+ public ICommandPump run<Command>() where Command : gorilla.commons.utility.Command
{
return run(registry.get_a<Command>());
}
- public ICommandPump run<Command>(Command command) where Command : ICommand
+ public ICommandPump run<Command>(Command command) where Command : gorilla.commons.utility.Command
{
processor.add(command);
return this;
}
- public ICommandPump run<Command, T>(T input) where Command : IParameterizedCommand<T>
+ public ICommandPump run<Command, T>(T input) where Command : ParameterizedCommand<T>
{
processor.add(() => registry.get_a<Command>().run(input));
return this;
}
- public ICommandPump run<T>(ICallback<T> item, IQuery<T> query)
+ public ICommandPump run<T>(Callback<T> item, Query<T> query)
{
return run(factory.create_for(item, query));
}
- public ICommandPump run<Output, Query>(ICallback<Output> item) where Query : IQuery<Output>
+ public ICommandPump run<Output, Query>(Callback<Output> item) where Query : Query<Output>
{
return run(item, registry.get_a<Query>());
}
product/Presentation/Presenters/display_the_splash_screen.cs
@@ -1,33 +0,0 @@
-using System;
-using MoMoney.Presentation.Views;
-using MoMoney.Service.Infrastructure.Threading;
-
-namespace MoMoney.Presentation.Presenters
-{
- public class display_the_splash_screen : ISplashScreenState
- {
- readonly ITimer timer;
- readonly ISplashScreenView view;
- readonly ISplashScreenPresenter presenter;
-
- public display_the_splash_screen(ITimer timer, ISplashScreenView view, ISplashScreenPresenter presenter)
- {
- this.timer = timer;
- this.view = view;
- this.presenter = presenter;
- timer.start_notifying(presenter, new TimeSpan(50));
- }
-
- public void update()
- {
- if (view.current_opacity() < 1)
- {
- view.increment_the_opacity();
- }
- else
- {
- timer.stop_notifying(presenter);
- }
- }
- }
-}
\ No newline at end of file
product/Presentation/Presenters/ExpandoBuilder.cs
@@ -1,13 +1,13 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
+using MoMoney.Presentation.Presenters;
using XPExplorerBar;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IExpandoBuilder : IBuilder<Expando>
+ public interface IExpandoBuilder : Builder<Expando>
{
IExpandoBuilder named(string name);
IExpandoBuilder with_item(IExpandoItemBuilder builder);
product/Presentation/Presenters/ExpandoItemBuilder.cs
@@ -1,13 +1,13 @@
using System;
using System.Drawing;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Winforms.Resources;
using XPExplorerBar;
namespace MoMoney.Presentation.Presenters
{
- public interface IExpandoItemBuilder : IBuilder<TaskItem>
+ public interface IExpandoItemBuilder : Builder<TaskItem>
{
IExpandoItemBuilder named(string name);
IExpandoItemBuilder represented_by_image(ApplicationImage image);
@@ -19,7 +19,7 @@ namespace MoMoney.Presentation.Presenters
{
string the_name = "";
Image the_image;
- Action the_action = () => { };
+ Action the_action = () => {};
public IExpandoItemBuilder named(string name)
{
@@ -32,7 +32,7 @@ namespace MoMoney.Presentation.Presenters
the_image = image;
return this;
}
-
+
public IExpandoItemBuilder represented_by_icon(HybridIcon icon)
{
the_image = icon;
@@ -48,15 +48,15 @@ namespace MoMoney.Presentation.Presenters
public TaskItem build()
{
var item = new TaskItem
- {
- Anchor = ((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right),
- BackColor = Color.Transparent,
- Image = the_image,
- Name = "ux" + the_name,
- Text = the_name,
- UseVisualStyleBackColor = false,
- ShowFocusCues = true,
- };
+ {
+ Anchor = ((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right),
+ BackColor = Color.Transparent,
+ Image = the_image,
+ Name = "ux" + the_name,
+ Text = the_name,
+ UseVisualStyleBackColor = false,
+ ShowFocusCues = true,
+ };
item.Click += (sender, e) => the_action();
return item;
}
product/Presentation/Presenters/GettingStartedPresenter.cs
@@ -1,7 +1,7 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IGettingStartedPresenter : IContentPresenter
{
product/Presentation/Presenters/GettingStartedPresenterSpecs.cs
@@ -1,9 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public class GettingStartedPresenterSpecs
{
product/Presentation/Presenters/hide_the_splash_screen.cs
@@ -1,8 +1,9 @@
using System;
-using MoMoney.Presentation.Views;
+using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public class hide_the_splash_screen : ISplashScreenState
{
product/Presentation/Presenters/IActionTaskPaneFactory.cs
@@ -1,9 +1,7 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using XPExplorerBar;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IActionTaskPaneFactory : IFactory<Expando>
- {
- }
+ public interface IActionTaskPaneFactory : Factory<Expando> {}
}
\ No newline at end of file
product/Presentation/Presenters/ISplashScreenState.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface ISplashScreenState
{
product/Presentation/Presenters/LogFilePresenter.cs
@@ -1,8 +1,8 @@
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Service.Contracts.Infrastructure.Logging;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface ILogFilePresenter : IContentPresenter
{
product/Presentation/Presenters/LogFileViewPresenterSpecs.cs
@@ -1,9 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Service.Contracts.Infrastructure.Logging;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public class behaves_like_log_file_presenter : concerns_for<ILogFilePresenter, LogFilePresenter>
{
product/Presentation/Presenters/MainMenuPresenter.cs
@@ -1,13 +1,12 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Presenters
{
- public interface IMainMenuPresenter : IContentPresenter
- {
- }
+ public interface IMainMenuPresenter : IContentPresenter {}
public class MainMenuPresenter : ContentPresenter<IMainMenuView>, IMainMenuPresenter
{
product/Presentation/Presenters/NotificationIconPresenter.cs
@@ -1,10 +1,11 @@
using System.Net.NetworkInformation;
-using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views;
+using MoMoney.Presentation;
+using momoney.presentation.model.events;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface INotificationIconPresenter : IModule,
IEventSubscriber<ClosingTheApplication>,
product/Presentation/Presenters/NotificationIconPresenterSpecs.cs
@@ -1,10 +1,10 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
[Concern(typeof (NotificationIconPresenter))]
public abstract class behaves_like_notification_icon_presenter : concerns_for<INotificationIconPresenter, NotificationIconPresenter>
product/Presentation/Presenters/NotificationPresenter.cs
@@ -1,11 +1,10 @@
using System.Text;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public class NotificationPresenter : INotification
+ public class NotificationPresenter : Notification
{
public void notify(params NotificationMessage[] messages)
{
product/Presentation/Presenters/ProcessQueryCommand.cs
@@ -1,28 +1,26 @@
using System;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Infrastructure.Threading;
+using gorilla.commons.utility;
+using momoney.service.infrastructure.threading;
namespace MoMoney.Presentation.Presenters
{
- public interface IProcessQueryCommand<T> : IParameterizedCommand<ICallback<T>>
- {
- }
+ public interface IProcessQueryCommand<T> : ParameterizedCommand<Callback<T>> {}
public class ProcessQueryCommand<T> : IProcessQueryCommand<T>
{
- readonly IQuery<T> query;
+ readonly Query<T> query;
readonly ISynchronizationContextFactory factory;
- public ProcessQueryCommand(IQuery<T> query, ISynchronizationContextFactory factory)
+ public ProcessQueryCommand(Query<T> query, ISynchronizationContextFactory factory)
{
this.query = query;
this.factory = factory;
}
- public void run(ICallback<T> callback)
+ public void run(Callback<T> callback)
{
var dto = query.fetch();
- factory.create().run(new ActionCommand((Action) (() => callback.run(dto))));
+ factory.create().run(new AnonymousCommand((Action) (() => callback.run(dto))));
}
}
}
\ No newline at end of file
product/Presentation/Presenters/ReportPresenter.cs
@@ -1,5 +1,5 @@
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.reporting;
using MoMoney.Presentation.Views;
@@ -8,17 +8,15 @@ namespace MoMoney.Presentation.Presenters
{
public interface IReportPresenter<Report, T, Query> : IContentPresenter
where Report : IBindReportTo<T, Query>
- where Query : IQuery<T>
- {
- }
+ where Query : Query<T> {}
public class ReportPresenter<Report, T, Query> : ContentPresenter<IReportViewer>, IReportPresenter<Report, T, Query>
where Report : IBindReportTo<T, Query>
- where Query : IQuery<T>
+ where Query : Query<T>
{
- readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
- public ReportPresenter(IReportViewer view, IDependencyRegistry registry) : base(view)
+ public ReportPresenter(IReportViewer view, DependencyRegistry registry) : base(view)
{
this.registry = registry;
}
product/Presentation/Presenters/RestartCommand.cs
@@ -1,13 +1,11 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IRestartCommand : ICommand
- {
- }
+ public interface IRestartCommand : Command {}
public class RestartCommand : IRestartCommand
{
product/Presentation/Presenters/RunQueryCommand.cs
@@ -1,17 +1,16 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using MoMoney.Presentation.Presenters;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IRunQueryCommand<T> : ICommand
- {
- }
+ public interface IRunQueryCommand<T> : Command {}
public class RunQueryCommand<T> : IRunQueryCommand<T>
{
- readonly ICallback<T> callback;
+ readonly Callback<T> callback;
readonly IProcessQueryCommand<T> command;
- public RunQueryCommand(ICallback<T> callback, IProcessQueryCommand<T> command)
+ public RunQueryCommand(Callback<T> callback, IProcessQueryCommand<T> command)
{
this.callback = callback;
this.command = command;
product/Presentation/Presenters/RunThe.cs
@@ -1,12 +1,10 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
- public interface IRunThe<TPresenter> : ICommand where TPresenter : IPresenter
- {
- }
+ public interface IRunThe<TPresenter> : Command where TPresenter : IPresenter {}
public class RunThe<TPresenter> : IRunThe<TPresenter> where TPresenter : IPresenter
{
product/Presentation/Presenters/RunTheSpecs.cs
@@ -4,29 +4,28 @@ using MbUnit.Framework;
using MoMoney.Presentation.Core;
using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public class RunTheSpecs
{
- }
-
- [Ignore]
- [Concern(typeof (RunThe<>))]
- public class when_initializing_different_regions_of_the_user_interface :
- concerns_for<IRunThe<IPresenter>, RunThe<IPresenter>>
- {
- //it should_initialize_the_presenter_that_controls_that_region = () => controller.was_told_to(x => x.run<IPresenter>());
- it should_initialize_the_presenter_that_controls_that_region = () => processor.was_told_to(x => x.add(() => controller.run<IPresenter>()));
-
- context c = () =>
+ [Ignore]
+ [Concern(typeof (RunThe<>))]
+ public class when_initializing_different_regions_of_the_user_interface :
+ concerns_for<IRunThe<IPresenter>, RunThe<IPresenter>>
{
- controller = the_dependency<IApplicationController>();
- processor = the_dependency<ICommandProcessor>();
- };
+ //it should_initialize_the_presenter_that_controls_that_region = () => controller.was_told_to(x => x.run<IPresenter>());
+ it should_initialize_the_presenter_that_controls_that_region = () => processor.was_told_to(x => x.add(() => controller.run<IPresenter>()));
+
+ context c = () =>
+ {
+ controller = the_dependency<IApplicationController>();
+ processor = the_dependency<ICommandProcessor>();
+ };
- because b = () => sut.run();
+ because b = () => sut.run();
- static IApplicationController controller;
- static ICommandProcessor processor;
+ static IApplicationController controller;
+ static ICommandProcessor processor;
+ }
}
}
\ No newline at end of file
product/Presentation/Presenters/SplashScreenPresenter.cs
@@ -1,13 +1,13 @@
-using MoMoney.Presentation.Views;
+using gorilla.commons.Utility;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Views;
+using momoney.service.infrastructure.threading;
using MoMoney.Service.Infrastructure.Threading;
-using MoMoney.Utility.Core;
namespace MoMoney.Presentation.Presenters
{
- public interface ISplashScreenPresenter : IDisposableCommand, ITimerClient
- {
- }
+ public interface ISplashScreenPresenter : DisposableCommand, ITimerClient {}
public class SplashScreenPresenter : ISplashScreenPresenter
{
@@ -15,9 +15,7 @@ namespace MoMoney.Presentation.Presenters
readonly ISplashScreenView view;
ISplashScreenState current_state;
- public SplashScreenPresenter() : this(new IntervalTimer(), new SplashScreenView())
- {
- }
+ public SplashScreenPresenter() : this(new IntervalTimer(), new SplashScreenView()) {}
public SplashScreenPresenter(ITimer timer, ISplashScreenView view)
{
@@ -28,7 +26,7 @@ namespace MoMoney.Presentation.Presenters
public void run()
{
view.display();
- current_state = new display_the_splash_screen(timer, view, this);
+ current_state = new DisplayTheSplashScreen(timer, view, this);
}
public void Dispose()
product/Presentation/Presenters/SplashScreenPresenterSpecs.cs
@@ -1,7 +1,7 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Threading;
namespace MoMoney.Presentation.Presenters
product/Presentation/Presenters/StatusBarPresenter.cs
@@ -1,7 +1,7 @@
using System;
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Infrastructure.Eventing;
product/Presentation/Presenters/StatusBarPresenterSpecs.cs
@@ -1,8 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
+using MoMoney.Service.Infrastructure.Eventing;
namespace MoMoney.Presentation.Presenters
{
@@ -13,12 +14,14 @@ namespace MoMoney.Presentation.Presenters
() => view.was_told_to(v => v.display(ApplicationIcons.green_circle, "Ready"));
context c = () =>
- {
- view = the_dependency<IStatusBarView>();
- };
+ {
+ view = the_dependency<IStatusBarView>();
+ broker = the_dependency<IEventAggregator>();
+ };
because b = () => sut.notify(new NewProjectOpened(""));
static IStatusBarView view;
+ static IEventAggregator broker;
}
}
\ No newline at end of file
product/Presentation/Presenters/TaskTrayPresenter.cs
@@ -1,18 +1,18 @@
-using System.ComponentModel;
-using Gorilla.Commons.Infrastructure.Logging;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views;
+using gorilla.commons.utility;
+using MoMoney.Presentation;
+using momoney.presentation.model.events;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Eventing;
-using momoney.utility;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface ITaskTrayPresenter : IModule,
IEventSubscriber<SavedChangesEvent>,
IEventSubscriber<StartedRunningCommand>,
IEventSubscriber<FinishedRunningCommand>,
- IEventSubscriber<NewProjectOpened> {}
+ IEventSubscriber<NewProjectOpened>
+ {
+ }
public class TaskTrayPresenter : ITaskTrayPresenter
{
@@ -45,16 +45,7 @@ namespace MoMoney.Presentation.Presenters
public void notify(StartedRunningCommand message)
{
- this.log().debug("running {0}", message.running_action);
- if (message.running_action.is_decorated_with<DisplayNameAttribute>())
- {
- var attribute = message.running_action.attribute<DisplayNameAttribute>();
- view.display("Running... {0}".formatted_using(attribute.DisplayName));
- }
- else
- {
- view.display("Running... {0}".formatted_using(message.running_action));
- }
+ view.display("Running... {0}".formatted_using(message.running_action));
}
public void notify(FinishedRunningCommand message)
product/Presentation/Presenters/TitleBarPresenter.cs
@@ -1,10 +1,11 @@
using Gorilla.Commons.Infrastructure.Logging;
-using MoMoney.Presentation.Model.messages;
+using MoMoney.Presentation;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface ITitleBarPresenter : IModule,
IEventSubscriber<UnsavedChangesEvent>,
product/Presentation/Presenters/TitleBarPresenterSpecs.cs
@@ -1,11 +1,11 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Model.messages;
+using momoney.presentation.model.events;
using MoMoney.Presentation.Model.Projects;
using MoMoney.Presentation.Views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
[Concern(typeof (TitleBarPresenter))]
public abstract class behaves_like_a_title_bar_presenter : concerns_for<ITitleBarPresenter, TitleBarPresenter>
product/Presentation/Presenters/ToolBarPresenter.cs
@@ -1,14 +1,14 @@
using System.Collections.Generic;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Core;
using MoMoney.Presentation.Model.Menu;
-using MoMoney.Presentation.Model.Menu.File;
+using momoney.presentation.model.menu.file;
using MoMoney.Presentation.Model.Projects;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IToolbarPresenter : IPresenter
{
product/Presentation/Presenters/UnhandledErrorPresenter.cs
@@ -1,9 +1,10 @@
+using MoMoney.Presentation;
using MoMoney.Presentation.Core;
-using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views;
+using momoney.presentation.model.events;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IUnhandledErrorPresenter : IModule, IPresenter,
IEventSubscriber<UnhandledErrorOccurred>
product/Presentation/Presenters/UnhandledErrorPresenterSpecs.cs
@@ -1,11 +1,11 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Model.messages;
-using MoMoney.Presentation.Views;
+using momoney.presentation.model.events;
+using momoney.presentation.views;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public class behaves_like_unhandled_error_presenter :
concerns_for<IUnhandledErrorPresenter, UnhandledErrorPresenter>
product/Presentation/Presenters/ViewAllBillsPresenter.cs
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using MoMoney.DTO;
using MoMoney.Presentation.Core;
+using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
using MoMoney.Service.Contracts.Application;
-namespace MoMoney.Presentation.Presenters
+namespace momoney.presentation.presenters
{
public interface IViewAllBillsPresenter : IContentPresenter
{
product/Presentation/Views/ControlAction.cs
@@ -1,6 +1,6 @@
using System;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public delegate void ControlAction<T>(T input) where T : EventArgs;
}
\ No newline at end of file
product/Presentation/Views/IAboutApplicationView.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IAboutApplicationView : IDockedContentView
{
product/Presentation/Views/IAddBillPaymentView.cs
@@ -1,14 +1,12 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IAddBillPaymentView : IDockedContentView,
IView<IAddBillPaymentPresenter>,
- ICallback<IEnumerable<CompanyDTO>>,
- ICallback<IEnumerable<BillInformationDTO>>
- {
- }
+ Callback<IEnumerable<CompanyDTO>>,
+ Callback<IEnumerable<BillInformationDTO>> {}
}
\ No newline at end of file
product/Presentation/Views/IAddCompanyView.cs
@@ -1,13 +1,12 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
public interface IAddCompanyView : IDockedContentView,
IView<IAddCompanyPresenter>,
- ICallback<IEnumerable<CompanyDTO>>
- {
- }
+ Callback<IEnumerable<CompanyDTO>> {}
}
\ No newline at end of file
product/Presentation/Views/IAddNewIncomeView.cs
@@ -1,14 +1,13 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
public interface IAddNewIncomeView : IDockedContentView,
IView<IAddNewIncomePresenter>,
- ICallback<IEnumerable<CompanyDTO>>,
- ICallback<IEnumerable<IncomeInformationDTO>>
- {
- }
+ Callback<IEnumerable<CompanyDTO>>,
+ Callback<IEnumerable<IncomeInformationDTO>> {}
}
\ No newline at end of file
product/Presentation/Views/IApplicationDockedWindow.cs
@@ -1,3 +1,4 @@
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
using WeifenLuo.WinFormsUI.Docking;
product/Presentation/Views/IApplicationWindow.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IApplicationWindow : IView
{
product/Presentation/Views/ICheckForUpdatesView.cs
@@ -1,11 +1,11 @@
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
- public interface ICheckForUpdatesView : IView<ICheckForUpdatesPresenter>, ICallback<ApplicationVersion>
+ public interface ICheckForUpdatesView : IView<ICheckForUpdatesPresenter>, Callback<ApplicationVersion>
{
void display();
void downloaded(Percent percentage_complete);
product/Presentation/Views/ICommandDialog.cs
@@ -1,8 +1,4 @@
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
- public interface ICommandDialog<Command> where Command : ICommand
- {
- }
+ public interface ICommandDialog<Command> where Command : gorilla.commons.utility.Command {}
}
\ No newline at end of file
product/Presentation/Views/IDialogLauncher.cs
@@ -1,9 +1,7 @@
-using Gorilla.Commons.Utility.Core;
-
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IDialogLauncher
{
- void launch<Command>(Command command) where Command : ICommand;
+ void launch<Command>(Command command) where Command : gorilla.commons.utility.Command;
}
}
\ No newline at end of file
product/Presentation/Views/IDockedContentView.cs
@@ -1,6 +1,6 @@
using WeifenLuo.WinFormsUI.Docking;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IDockedContentView : IDockContent, IView
{
product/Presentation/Views/IGettingStartedView.cs
@@ -1,6 +1,6 @@
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IGettingStartedView : IDockedContentView,
IView<IGettingStartedPresenter>
product/Presentation/Views/ILogFileView.cs
@@ -1,8 +1,8 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
- public interface ILogFileView : IDockedContentView, ICallback<string>
+ public interface ILogFileView : IDockedContentView, Callback<string>
{
void display(string file_path);
}
product/Presentation/Views/IMainMenuView.cs
@@ -1,4 +1,5 @@
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/INotificationIconView.cs
@@ -1,7 +1,7 @@
using System;
using MoMoney.Presentation.Winforms.Resources;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface INotificationIconView : IDisposable
{
product/Presentation/Views/IRegionManager.cs
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IRegionManager
{
product/Presentation/Views/IReportViewer.cs
@@ -1,4 +1,5 @@
using MoMoney.Presentation.Model.reporting;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ISaveChangesView.cs
@@ -1,6 +1,6 @@
using MoMoney.Presentation.Model.Menu.File;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface ISaveChangesView : IView<ISaveChangesPresenter>
{
product/Presentation/Views/ISelectFileToOpenDialog.cs
@@ -1,9 +1,9 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface ISelectFileToOpenDialog
{
- IFile tell_me_the_path_to_the_file();
+ File tell_me_the_path_to_the_file();
}
}
\ No newline at end of file
product/Presentation/Views/ISelectFileToSaveToDialog.cs
@@ -1,9 +1,9 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface ISelectFileToSaveToDialog
{
- IFile tell_me_the_path_to_the_file();
+ File tell_me_the_path_to_the_file();
}
}
\ No newline at end of file
product/Presentation/Views/IShell.cs
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Windows.Forms;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ISplashScreenView.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface ISplashScreenView
{
product/Presentation/Views/IStatusBarView.cs
@@ -1,5 +1,5 @@
using MoMoney.Presentation.Winforms.Resources;
-using MoMoney.Service.Infrastructure.Threading;
+using momoney.service.infrastructure.threading;
namespace MoMoney.Presentation.Views
{
product/Presentation/Views/ITaskTrayMessageView.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface ITaskTrayMessageView
{
product/Presentation/Views/IUnhandledErrorView.cs
@@ -1,7 +1,7 @@
using System;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IUnhandledErrorView : IView<IUnhandledErrorPresenter>
{
product/Presentation/Views/IView.cs
@@ -1,8 +1,9 @@
using System;
using System.ComponentModel;
using MoMoney.Presentation.Core;
+using MoMoney.Presentation.Views;
-namespace MoMoney.Presentation.Views
+namespace momoney.presentation.views
{
public interface IView : IWindowEvents, ISynchronizeInvoke, IDisposable
{
product/Presentation/Views/IViewAllBills.cs
@@ -1,13 +1,14 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
public interface IViewAllBills : IDockedContentView,
IView<IViewAllBillsPresenter>,
- ICallback<IEnumerable<BillInformationDTO>>
+ Callback<IEnumerable<BillInformationDTO>>
{
}
}
\ No newline at end of file
product/Presentation/Views/IViewIncomeHistory.cs
@@ -1,13 +1,14 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
public interface IViewIncomeHistory : IDockedContentView,
IView<IViewIncomeHistoryPresenter>,
- ICallback<IEnumerable<IncomeInformationDTO>>
+ Callback<IEnumerable<IncomeInformationDTO>>
{
}
product/Presentation/Views/IWindowEvents.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Views
{
product/Presentation/Winforms/Databinding/ComboBoxPropertyBinding.cs
@@ -1,18 +1,21 @@
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Databinding
{
public class ComboBoxPropertyBinding<TypeToBindTo, PropertyType> : IPropertyBinding<PropertyType>
{
- private readonly IPropertyBinder<TypeToBindTo, PropertyType> binder;
+ readonly IPropertyBinder<TypeToBindTo, PropertyType> binder;
public ComboBoxPropertyBinding(ComboBox control, IPropertyBinder<TypeToBindTo, PropertyType> binder)
{
this.binder = binder;
control.SelectedItem = binder.current_value();
control.SelectedIndexChanged +=
- delegate { binder.change_value_of_property_to(control.SelectedItem.converted_to<PropertyType>()); };
+ delegate
+ {
+ binder.change_value_of_property_to(control.SelectedItem.converted_to<PropertyType>());
+ };
}
public PropertyType current_value()
product/Presentation/Winforms/Databinding/ListboxExtensions.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Databinding
{
product/Presentation/Winforms/Databinding/PropertyInspector.cs
@@ -1,7 +1,7 @@
using System;
using System.Linq.Expressions;
using System.Reflection;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Databinding
{
product/Presentation/Winforms/Databinding/TextPropertyBinding.cs
@@ -1,5 +1,5 @@
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Databinding
{
product/Presentation/Winforms/Helpers/BindableListBox.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
product/Presentation/Winforms/Helpers/BindableTextBox.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
product/Presentation/Winforms/Helpers/BindableTextBoxExtensions.cs
@@ -1,6 +1,6 @@
using System;
using System.Linq.Expressions;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
product/Presentation/Winforms/Helpers/BindableTextBoxExtensionsSpecs.cs
@@ -12,7 +12,7 @@ namespace MoMoney.Presentation.Winforms.Helpers
[Concern(typeof (BindableTextBoxExtensions))]
public class when_binding_a_text_control_to_a_command : concerns
{
- it should_run_each_command_when_the_text_changes_in_the_text_control = () => command.was_told_to(x => x.run(result));
+ it should_run_each_command_when_the_text_changes_in_the_text_control = () => command.was_told_to<ITextBoxCommand<string>>(x => x.run(result));
context c = () =>
{
product/Presentation/Winforms/Helpers/BindableTextBoxSpecs.cs
@@ -1,53 +1,62 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
public class BindableTextBoxSpecs
{
- }
-
- [Concern(typeof (BindableTextBox<>))]
- public class concerns_for_text_box : concerns_for<IBindableTextBox<string>, BindableTextBox<string>>
- {
- context c = () => { control = the_dependency<ITextControl<string>>(); };
-
- static protected ITextControl<string> control;
- }
-
- [Concern(typeof (BindableTextBox<>))]
- public class when_binding_an_item_to_a_textbox : concerns_for_text_box
- {
- it should_change_the_text_of_the_text_control = () => control.was_told_to(x => x.set_selected_item("shrek"));
-
- because b = () => sut.bind_to("shrek");
- }
-
- [Concern(typeof (BindableTextBox<>))]
- public class when_getting_the_current_value_of_a_text_box : concerns_for_text_box
- {
- it should_return_the_current_value_of_the_text_box = () => result.should_be_equal_to("popeye");
-
- context c = () => when_the(control).is_told_to(x => x.get_selected_item()).it_will_return("popeye");
- because b = () => { result = sut.get_selected_value(); };
-
- static string result;
- }
-
- [Concern(typeof (BindableTextBox<>))]
- public class when_an_action_needs_to_be_performed_when_the_value_of_a_textbox_changes : concerns_for_text_box
- {
- it should_perform_that_action = () => action.was_told_to(x => x.run());
-
- context c = () => { action = an<ICommand>(); };
-
- because b = () =>
- {
- sut.on_leave(x => action.run());
- control.when_text_is_changed();
- };
-
- static ICommand action;
+ [Concern(typeof (BindableTextBox<>))]
+ public class concerns_for_text_box : concerns_for<IBindableTextBox<string>, BindableTextBox<string>>
+ {
+ context c = () =>
+ {
+ control = the_dependency<ITextControl<string>>();
+ };
+
+ static protected ITextControl<string> control;
+ }
+
+ [Concern(typeof (BindableTextBox<>))]
+ public class when_binding_an_item_to_a_textbox : concerns_for_text_box
+ {
+ it should_change_the_text_of_the_text_control = () => control.was_told_to(x => x.set_selected_item("shrek"));
+
+ because b = () => sut.bind_to("shrek");
+ }
+
+ [Concern(typeof (BindableTextBox<>))]
+ public class when_getting_the_current_value_of_a_text_box : concerns_for_text_box
+ {
+ it should_return_the_current_value_of_the_text_box = () => result.should_be_equal_to("popeye");
+
+ context c = () => when_the(control).is_told_to(x => x.get_selected_item()).it_will_return("popeye");
+
+ because b = () =>
+ {
+ result = sut.get_selected_value();
+ };
+
+ static string result;
+ }
+
+ [Concern(typeof (BindableTextBox<>))]
+ public class when_an_action_needs_to_be_performed_when_the_value_of_a_textbox_changes : concerns_for_text_box
+ {
+ it should_perform_that_action = () => action.was_told_to(x => x.run());
+
+ context c = () =>
+ {
+ action = an<Command>();
+ };
+
+ because b = () =>
+ {
+ sut.on_leave(x => action.run());
+ control.when_text_is_changed();
+ };
+
+ static Command action;
+ }
}
}
\ No newline at end of file
product/Presentation/Winforms/Helpers/ButtonExtensions.cs
@@ -2,7 +2,6 @@ using System;
using System.Drawing;
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
namespace MoMoney.Presentation.Winforms.Helpers
{
@@ -22,9 +21,12 @@ namespace MoMoney.Presentation.Winforms.Helpers
return button;
}
- static public Button will_execute<Command>(this Button button, Func<bool> when) where Command : ICommand
+ static public Button will_execute<Command>(this Button button, Func<bool> when) where Command : gorilla.commons.utility.Command
{
- button.Click += (sender, e) => { if (when()) Resolve.the<Command>().run(); };
+ button.Click += (sender, e) =>
+ {
+ if (when()) Resolve.the<Command>().run();
+ };
button.Enabled = when();
return button;
}
@@ -32,14 +34,14 @@ namespace MoMoney.Presentation.Winforms.Helpers
static public Control with_tool_tip(this Control control, string title, string caption)
{
var tip = new ToolTip
- {
- IsBalloon = true,
- ToolTipTitle = title,
- ToolTipIcon = ToolTipIcon.Info,
- UseAnimation = true,
- UseFading = true,
- AutoPopDelay = 10000,
- };
+ {
+ IsBalloon = true,
+ ToolTipTitle = title,
+ ToolTipIcon = ToolTipIcon.Info,
+ UseAnimation = true,
+ UseFading = true,
+ AutoPopDelay = 10000,
+ };
tip.SetToolTip(control, caption);
control.Controls.Add(new ControlAdapter(tip));
return control;
product/Presentation/Winforms/Helpers/EventTrigger.cs
@@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
- public static class EventTrigger
+ static public class EventTrigger
{
const BindingFlags binding_flags =
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.Instance;
@@ -22,7 +22,7 @@ namespace MoMoney.Presentation.Winforms.Helpers
expression_handlers[ExpressionType.Constant] = get_constant_value;
}
- public static void trigger_event<Target>(Expression<Action<Target>> expression_representing_event_to_raise,
+ static public void trigger_event<Target>(Expression<Action<Target>> expression_representing_event_to_raise,
object target) where Target : IEventTarget
{
var method_call_expression = expression_representing_event_to_raise.Body.downcast_to<MethodCallExpression>();
product/Presentation/Winforms/Helpers/ITextBoxCommand.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
- public interface ITextBoxCommand<T> : IParameterizedCommand<IBindableTextBox<T>>
- {
- }
+ public interface ITextBoxCommand<T> : ParameterizedCommand<IBindableTextBox<T>> {}
}
\ No newline at end of file
product/Presentation/Winforms/Helpers/TextControlSpecs.cs
@@ -2,13 +2,12 @@ using System;
using System.Windows.Forms;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Helpers
{
public class TextControlSpecs
{
- }
[Concern(typeof (TextControl<>))]
public abstract class behaves_like_text_control : concerns_for<ITextControl<DateTime>, TextControl<DateTime>>
@@ -42,7 +41,7 @@ namespace MoMoney.Presentation.Winforms.Helpers
{
it should_invoke_the_action_bound_to_it = () => action.was_told_to(x => x.run());
- context c = () => { action = an<ICommand>(); };
+ context c = () => { action = an<Command>(); };
because b = () =>
{
@@ -50,7 +49,7 @@ namespace MoMoney.Presentation.Winforms.Helpers
textbox.control_is(x => x.OnLeave(new EventArgs()));
};
- static ICommand action;
+ static Command action;
}
[Concern(typeof (TextControl<>))]
@@ -60,4 +59,5 @@ namespace MoMoney.Presentation.Winforms.Helpers
because b = () => textbox.control_is(x => x.OnLeave(new EventArgs()));
}
+ }
}
\ No newline at end of file
product/Presentation/Winforms/Krypton/ListboxExtensions.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using ComponentFactory.Krypton.Toolkit;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Krypton
{
product/Presentation/Winforms/Resources/ApplicationIcons.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Resources
{
product/Presentation/Winforms/Views/AboutTheApplicationView.cs
@@ -1,7 +1,7 @@
using System;
using System.Reflection;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Views;
+using gorilla.commons.utility;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
@@ -24,9 +24,7 @@ namespace MoMoney.Presentation.Winforms.Views
ux_logo.Image = ApplicationImages.Splash;
}
- public void display()
- {
- }
+ public void display() {}
string assembly_version
{
product/Presentation/Winforms/Views/AddBillPaymentView.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Krypton;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/AddCompanyView.cs
@@ -2,18 +2,19 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Databinding;
using MoMoney.Presentation.Winforms.Resources;
+using gorilla.commons.utility;
namespace MoMoney.Presentation.Winforms.Views
{
public partial class AddCompanyView : ApplicationDockedWindow, IAddCompanyView
{
- ControlAction<EventArgs> submit_button = x => { };
+ ControlAction<EventArgs> submit_button = x => {};
readonly RegisterNewCompany dto;
public AddCompanyView()
product/Presentation/Winforms/Views/AddNewIncomeView.cs
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Krypton;
product/Presentation/Winforms/Views/ApplicationDockedWindow.cs
@@ -2,7 +2,8 @@ using System;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/ApplicationShell.cs
@@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Presenters;
+using gorilla.commons.utility;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
@@ -20,17 +21,17 @@ namespace MoMoney.Presentation.Winforms.Views
{
InitializeComponent();
regions = new Dictionary<string, IComponent>
- {
- {GetType().FullName, this},
- {typeof (Form).FullName, this},
- {ux_main_menu_strip.GetType().FullName, ux_main_menu_strip},
- {ux_dock_panel.GetType().FullName, ux_dock_panel},
- {ux_tool_bar_strip.GetType().FullName, ux_tool_bar_strip},
- {ux_status_bar.GetType().FullName, ux_status_bar},
- {notification_icon.GetType().FullName, notification_icon},
- {status_bar_label.GetType().FullName, status_bar_label},
- {status_bar_progress_bar.GetType().FullName, status_bar_progress_bar}
- };
+ {
+ {GetType().FullName, this},
+ {typeof (Form).FullName, this},
+ {ux_main_menu_strip.GetType().FullName, ux_main_menu_strip},
+ {ux_dock_panel.GetType().FullName, ux_dock_panel},
+ {ux_tool_bar_strip.GetType().FullName, ux_tool_bar_strip},
+ {ux_status_bar.GetType().FullName, ux_status_bar},
+ {notification_icon.GetType().FullName, notification_icon},
+ {status_bar_label.GetType().FullName, status_bar_label},
+ {status_bar_progress_bar.GetType().FullName, status_bar_progress_bar}
+ };
Closed += (o, e) => closed_action(e);
}
product/Presentation/Winforms/Views/ApplicationShellSpecs.cs
@@ -1,7 +1,7 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
product/Presentation/Winforms/Views/ApplicationWindow.cs
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/CheckForUpdatesView.cs
@@ -3,7 +3,8 @@ using System.Reflection;
using System.Windows.Forms;
using Gorilla.Commons.Utility;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/LogFileView.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/MainMenuView.cs
@@ -1,4 +1,4 @@
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/NotificationIconView.cs
@@ -1,10 +1,10 @@
using System.Windows.Forms;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Model.Menu;
using MoMoney.Presentation.Model.Menu.File;
using MoMoney.Presentation.Model.Menu.Help;
using MoMoney.Presentation.Model.Menu.window;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
using MenuItem=System.Windows.Forms.MenuItem;
product/Presentation/Winforms/Views/ReportViewer.cs
@@ -1,5 +1,5 @@
using DataDynamics.ActiveReports;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Presentation.Model.reporting;
using MoMoney.Presentation.Views;
product/Presentation/Winforms/Views/SaveChangesView.cs
@@ -2,7 +2,7 @@ using System;
using System.ComponentModel;
using System.Windows.Forms;
using MoMoney.Presentation.Model.Menu.File;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/SelectFileToOpenDialog.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Winforms.Views
{
@@ -15,7 +15,7 @@ namespace MoMoney.Presentation.Winforms.Views
dialog = new OpenFileDialog {Filter = "My Money Files (*.mo)|*.mo"};
}
- public IFile tell_me_the_path_to_the_file()
+ public File tell_me_the_path_to_the_file()
{
var result = dialog.ShowDialog(window);
var path_to_the_file =
product/Presentation/Winforms/Views/SelectFileToSaveToDialog.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Winforms.Views
{
@@ -15,7 +15,7 @@ namespace MoMoney.Presentation.Winforms.Views
this.window = window;
}
- public IFile tell_me_the_path_to_the_file()
+ public File tell_me_the_path_to_the_file()
{
var result = dialog.ShowDialog(window);
var the_path = (ApplicationFile) (result == DialogResult.Cancel ? string.Empty : dialog.FileName);
product/Presentation/Winforms/Views/SplashScreenView.cs
@@ -1,6 +1,6 @@
using System;
using System.Windows.Forms;
-using MoMoney.Presentation.Views;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/StatusBarView.cs
@@ -1,4 +1,5 @@
using System.Windows.Forms;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/TaskTrayMessage.cs
@@ -1,5 +1,5 @@
-using Gorilla.Commons.Utility.Extensions;
-using MoMoney.Presentation.Views;
+using gorilla.commons.utility;
+using momoney.presentation.views;
namespace MoMoney.Presentation.Winforms.Views
{
product/Presentation/Winforms/Views/TitleBar.cs
@@ -1,4 +1,5 @@
using System.Windows.Forms;
+using momoney.presentation.views;
using MoMoney.Presentation.Views;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/UnhandledErrorView.cs
@@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
-using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Resources;
namespace MoMoney.Presentation.Winforms.Views
product/Presentation/Winforms/Views/ViewAllBills.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using MoMoney.DTO;
-using MoMoney.Presentation.Presenters;
+using momoney.presentation.presenters;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/Winforms/Views/ViewAllBillsReport.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using DataDynamics.ActiveReports;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Model.reporting;
using MoMoney.Presentation.Views;
product/Presentation/Winforms/Views/ViewAllIncome.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Presenters;
using MoMoney.Presentation.Views;
@@ -15,9 +15,7 @@ namespace MoMoney.Presentation.Winforms.Views
titled("View All Income").icon(ApplicationIcons.ViewAllIncome);
}
- public void attach_to(IViewIncomeHistoryPresenter presenter)
- {
- }
+ public void attach_to(IViewIncomeHistoryPresenter presenter) {}
public void run(IEnumerable<IncomeInformationDTO> summary)
{
product/Presentation/Winforms/Views/ViewAllIncomesReport.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using DataDynamics.ActiveReports;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.DTO;
using MoMoney.Presentation.Model.reporting;
using MoMoney.Presentation.Views;
product/Presentation/Winforms/Views/WelcomeScreen.cs
@@ -1,6 +1,6 @@
-using MoMoney.Presentation.Model.Menu.File;
-using MoMoney.Presentation.Presenters;
-using MoMoney.Presentation.Views;
+using momoney.presentation.model.menu.file;
+using momoney.presentation.presenters;
+using momoney.presentation.views;
using MoMoney.Presentation.Winforms.Helpers;
using MoMoney.Presentation.Winforms.Resources;
product/Presentation/IModule.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Presentation
{
- public interface IModule : ICommand
- {
- }
+ public interface IModule : Command {}
}
\ No newline at end of file
product/Presentation/Presentation.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.Presentation</RootNamespace>
- <AssemblyName>MoMoney.Presentation</AssemblyName>
+ <RootNamespace>momoney.presentation</RootNamespace>
+ <AssemblyName>momoney.presentation</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@@ -103,448 +103,444 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="Model\Messages\FinishedRunningCommand.cs" />
- <Compile Include="Model\Messages\StartedRunningCommand.cs" />
- <Compile Include="Model\Navigation\INavigationTreeVisitor.cs" />
- <Compile Include="Model\Navigation\ITreeBranch.cs" />
- <Compile Include="Model\Navigation\ITreeViewToRootNodeMapper.cs" />
- <Compile Include="Model\Reporting\IBindReportTo.cs" />
- <Compile Include="Presenters\CommandFactory.cs" />
- <Compile Include="Presenters\CommandPump.cs" />
- <Compile Include="Core\ApplicationController.cs" />
- <Compile Include="Core\ApplicationControllerSpecs.cs" />
- <Compile Include="Core\ApplicationEnvironment.cs" />
- <Compile Include="Core\ContentPresenter.cs" />
- <Compile Include="Core\IContentPresenter.cs" />
- <Compile Include="Core\IPresenter.cs" />
- <Compile Include="Core\PresenterRegistry.cs" />
+ <Compile Include="model\eventing\FinishedRunningCommand.cs" />
+ <Compile Include="model\eventing\StartedRunningCommand.cs" />
+ <Compile Include="model\navigation\INavigationTreeVisitor.cs" />
+ <Compile Include="model\navigation\ITreeBranch.cs" />
+ <Compile Include="model\navigation\ITreeViewToRootNodeMapper.cs" />
+ <Compile Include="model\reporting\IBindReportTo.cs" />
+ <Compile Include="presenters\CommandFactory.cs" />
+ <Compile Include="presenters\CommandPump.cs" />
+ <Compile Include="core\ApplicationController.cs" />
+ <Compile Include="core\ApplicationControllerSpecs.cs" />
+ <Compile Include="core\ApplicationEnvironment.cs" />
+ <Compile Include="core\ContentPresenter.cs" />
+ <Compile Include="core\IContentPresenter.cs" />
+ <Compile Include="core\IPresenter.cs" />
+ <Compile Include="core\PresenterRegistry.cs" />
<Compile Include="IModule.cs" />
- <Compile Include="Model\FileSystem\folder.cs" />
- <Compile Include="Model\Menu\create.cs" />
- <Compile Include="Model\Menu\File\CloseProjectCommand.cs" />
- <Compile Include="Model\Menu\File\CloseWindowCommand.cs" />
- <Compile Include="Model\Menu\File\ExitCommand.cs" />
- <Compile Include="Model\Menu\File\ExitCommandSpecs.cs" />
- <Compile Include="Model\Menu\File\FileMenu.cs" />
- <Compile Include="Model\Menu\File\NewCommand.cs" />
- <Compile Include="Model\Menu\File\NewCommandSpecs.cs" />
- <Compile Include="Model\Menu\File\OpenCommand.cs" />
- <Compile Include="Model\Menu\File\OpenCommandSpecs.cs" />
- <Compile Include="Model\Menu\File\SaveAsCommand.cs" />
- <Compile Include="Model\Menu\File\SaveAsCommandSpecs.cs" />
- <Compile Include="Model\Menu\File\SaveChangesCommand.cs" />
- <Compile Include="Model\Menu\File\SaveCommand.cs" />
- <Compile Include="Model\Menu\File\SaveCommandSpecs.cs" />
- <Compile Include="Model\Menu\Help\display_information_about_the_application.cs" />
- <Compile Include="Model\Menu\Help\HelpMenu.cs" />
- <Compile Include="Model\Menu\ISubMenu.cs" />
- <Compile Include="Model\Menu\IToolbarButton.cs" />
- <Compile Include="Model\Menu\IToolbarItemBuilder.cs" />
- <Compile Include="Model\Menu\MenuItem.cs" />
- <Compile Include="Model\Menu\MenuItemBuilder.cs" />
- <Compile Include="Model\Menu\MenuItemSeparator.cs" />
- <Compile Include="Model\Menu\SubMenu.cs" />
- <Compile Include="Model\Menu\SubMenuRegistry.cs" />
- <Compile Include="Model\Menu\ToolBarItemBuilder.cs" />
- <Compile Include="Model\Menu\Window\WindowMenu.cs" />
- <Compile Include="Model\Messages\ClosingProjectEvent.cs" />
- <Compile Include="Model\Messages\ClosingTheApplication.cs" />
- <Compile Include="Model\Messages\NewProjectOpened.cs" />
- <Compile Include="Model\Messages\SavedChangesEvent.cs" />
- <Compile Include="Model\Messages\UnhandledErrorOccurred.cs" />
- <Compile Include="Model\Messages\UnsavedChangesEvent.cs" />
- <Compile Include="Model\Navigation\AddNewIncomeBranch.cs" />
- <Compile Include="Model\Navigation\AddBillPaymentBranch.cs" />
- <Compile Include="Model\Navigation\AddNewBillBranch.cs" />
- <Compile Include="Model\Navigation\IBranchVisitor.cs" />
- <Compile Include="Model\Navigation\NavigationTreeVisitor.cs" />
- <Compile Include="Model\Navigation\NavigationTreeVisitorSpecs.cs" />
- <Compile Include="Model\Navigation\TreeBranch.cs" />
- <Compile Include="Model\Navigation\TreeViewToRootNodeMapper.cs" />
- <Compile Include="Model\Navigation\TreeBranchSpecs.cs" />
- <Compile Include="Model\Navigation\ViewAllBillsBranch.cs" />
- <Compile Include="Model\Projects\EmptyProject.cs" />
- <Compile Include="Model\Projects\FileNotSpecifiedException.cs" />
- <Compile Include="Model\Projects\IProject.cs" />
- <Compile Include="Model\Projects\IProjectController.cs" />
- <Compile Include="Model\Projects\Project.cs" />
- <Compile Include="Model\Projects\ProjectController.cs" />
- <Compile Include="Model\Projects\ProjectControllerSpecs.cs" />
- <Compile Include="Model\Reporting\IReport.cs" />
- <Compile Include="Model\Reporting\ReportBindingExtensions.cs" />
- <Compile Include="Model\Reporting\ReportBindingExtensionsSpecs.cs" />
- <Compile Include="Presenters\AddCompanyPresenter.cs" />
- <Compile Include="Presenters\AddCompanyPresenterSpecs.cs" />
- <Compile Include="Presenters\AddBillPaymentPresenter.cs" />
- <Compile Include="Presenters\IRunPresenterCommand.cs" />
- <Compile Include="Presenters\ViewAllBillsPresenter.cs" />
- <Compile Include="Presenters\RestartCommand.cs" />
- <Compile Include="Presenters\RunPresenterCommand.cs" />
- <Compile Include="Presenters\RunThe.cs" />
- <Compile Include="Presenters\RunTheSpecs.cs" />
- <Compile Include="Model\Excel\Cell.cs" />
- <Compile Include="Model\Excel\ChangeFontSize.cs" />
- <Compile Include="Model\Excel\CompositeCellVisitor.cs" />
- <Compile Include="Model\Excel\ConstrainedCellVisitor.cs" />
- <Compile Include="Model\Excel\ExcelUsage.cs" />
- <Compile Include="Model\Excel\FormatBackColor.cs" />
- <Compile Include="Model\Excel\ICell.cs" />
- <Compile Include="Model\Excel\ICellInterior.cs" />
- <Compile Include="Model\Excel\ICellVisitor.cs" />
- <Compile Include="Presenters\AddNewIncomePresenter.cs" />
- <Compile Include="Presenters\AddNewIncomePresenterSpecs.cs" />
- <Compile Include="Presenters\ViewIncomeHistoryPresenter.cs" />
- <Compile Include="Presenters\AboutTheApplicationPresenter.cs" />
- <Compile Include="Presenters\ApplicationMenuPresenter.cs" />
- <Compile Include="Presenters\AddBillingTaskPane.cs" />
- <Compile Include="Presenters\AddCompanyTaskPane.cs" />
- <Compile Include="Presenters\AddIncomeTaskPane.cs" />
- <Compile Include="Presenters\AddReportingTaskPane.cs" />
- <Compile Include="Presenters\Build.cs" />
- <Compile Include="Presenters\ExpandoBuilder.cs" />
- <Compile Include="Presenters\ExpandoItemBuilder.cs" />
- <Compile Include="Presenters\IActionTaskPaneFactory.cs" />
- <Compile Include="Presenters\MainMenuPresenter.cs" />
- <Compile Include="Presenters\NavigationPresenter.cs" />
- <Compile Include="Presenters\NavigationPresenterSpecs.cs" />
- <Compile Include="Presenters\ReportPresenter.cs" />
- <Compile Include="Presenters\ApplicationShellPresenter.cs" />
- <Compile Include="Presenters\GettingStartedPresenter.cs" />
- <Compile Include="Presenters\GettingStartedPresenterSpecs.cs" />
- <Compile Include="Presenters\LogFilePresenter.cs" />
- <Compile Include="Presenters\LogFileViewPresenterSpecs.cs" />
- <Compile Include="Presenters\NotificationIconPresenter.cs" />
- <Compile Include="Presenters\NotificationIconPresenterSpecs.cs" />
- <Compile Include="Presenters\NotificationPresenter.cs" />
- <Compile Include="Presenters\StatusBarPresenter.cs" />
- <Compile Include="Presenters\StatusBarPresenterSpecs.cs" />
- <Compile Include="Presenters\TaskTrayPresenter.cs" />
- <Compile Include="Presenters\TitleBarPresenter.cs" />
- <Compile Include="Presenters\TitleBarPresenterSpecs.cs" />
- <Compile Include="Presenters\ToolBarPresenter.cs" />
- <Compile Include="Presenters\UnhandledErrorPresenter.cs" />
- <Compile Include="Presenters\UnhandledErrorPresenterSpecs.cs" />
- <Compile Include="Presenters\display_the_splash_screen.cs" />
- <Compile Include="Presenters\hide_the_splash_screen.cs" />
- <Compile Include="Presenters\ISplashScreenState.cs" />
- <Compile Include="Presenters\SplashScreenPresenter.cs" />
- <Compile Include="Presenters\SplashScreenPresenterSpecs.cs" />
- <Compile Include="Presenters\CheckForUpdatesPresenter.cs" />
- <Compile Include="Presenters\CheckForUpdatesPresenterSpecs.cs" />
- <Compile Include="Presenters\ProcessQueryCommand.cs" />
- <Compile Include="Views\ISelectFileToOpenDialog.cs" />
- <Compile Include="Views\ISelectFileToSaveToDialog.cs" />
- <Compile Include="Views\ITaskTrayMessageView.cs" />
- <Compile Include="Views\ITitleBar.cs" />
- <Compile Include="Views\IViewAllBillsReport.cs" />
- <Compile Include="Views\IApplicationDockedWindow.cs" />
- <Compile Include="Views\IApplicationWindow.cs" />
- <Compile Include="Views\IViewAllIncomeReport.cs" />
- <Compile Include="Winforms\Resources\ApplicationIcons.cs" />
- <Compile Include="Winforms\Resources\ApplicationImages.cs" />
- <Compile Include="Presenters\RunQueryCommand.cs" />
- <Compile Include="Winforms\Views\AddCompanyView.cs">
+ <Compile Include="model\filesystem\folder.cs" />
+ <Compile Include="model\menu\create.cs" />
+ <Compile Include="model\menu\file\CloseProjectCommand.cs" />
+ <Compile Include="model\menu\file\CloseWindowCommand.cs" />
+ <Compile Include="model\menu\file\ExitCommand.cs" />
+ <Compile Include="model\menu\file\ExitCommandSpecs.cs" />
+ <Compile Include="model\menu\file\FileMenu.cs" />
+ <Compile Include="model\menu\file\NewCommand.cs" />
+ <Compile Include="model\menu\file\NewCommandSpecs.cs" />
+ <Compile Include="model\menu\file\OpenCommand.cs" />
+ <Compile Include="model\menu\file\OpenCommandSpecs.cs" />
+ <Compile Include="model\menu\file\SaveAsCommand.cs" />
+ <Compile Include="model\menu\file\SaveAsCommandSpecs.cs" />
+ <Compile Include="model\menu\file\SaveChangesCommand.cs" />
+ <Compile Include="model\menu\file\SaveCommand.cs" />
+ <Compile Include="model\menu\file\SaveCommandSpecs.cs" />
+ <Compile Include="model\menu\help\DisplayInformationAboutTheApplication.cs" />
+ <Compile Include="model\menu\help\HelpMenu.cs" />
+ <Compile Include="model\menu\ISubMenu.cs" />
+ <Compile Include="model\menu\IToolbarButton.cs" />
+ <Compile Include="model\menu\IToolbarItemBuilder.cs" />
+ <Compile Include="model\menu\MenuItem.cs" />
+ <Compile Include="model\menu\MenuItemBuilder.cs" />
+ <Compile Include="model\menu\MenuItemSeparator.cs" />
+ <Compile Include="model\menu\SubMenu.cs" />
+ <Compile Include="model\menu\SubMenuRegistry.cs" />
+ <Compile Include="model\menu\ToolBarItemBuilder.cs" />
+ <Compile Include="model\menu\window\WindowMenu.cs" />
+ <Compile Include="model\eventing\ClosingProjectEvent.cs" />
+ <Compile Include="model\eventing\ClosingTheApplication.cs" />
+ <Compile Include="model\eventing\NewProjectOpened.cs" />
+ <Compile Include="model\eventing\SavedChangesEvent.cs" />
+ <Compile Include="model\eventing\UnhandledErrorOccurred.cs" />
+ <Compile Include="model\eventing\UnsavedChangesEvent.cs" />
+ <Compile Include="model\navigation\AddNewIncomeBranch.cs" />
+ <Compile Include="model\navigation\AddBillPaymentBranch.cs" />
+ <Compile Include="model\navigation\AddNewBillBranch.cs" />
+ <Compile Include="model\navigation\IBranchVisitor.cs" />
+ <Compile Include="model\navigation\NavigationTreeVisitor.cs" />
+ <Compile Include="model\navigation\NavigationTreeVisitorSpecs.cs" />
+ <Compile Include="model\navigation\TreeBranch.cs" />
+ <Compile Include="model\navigation\TreeViewToRootNodeMapper.cs" />
+ <Compile Include="model\navigation\TreeBranchSpecs.cs" />
+ <Compile Include="model\navigation\ViewAllBillsBranch.cs" />
+ <Compile Include="model\projects\EmptyProject.cs" />
+ <Compile Include="model\projects\FileNotSpecifiedException.cs" />
+ <Compile Include="model\projects\IProject.cs" />
+ <Compile Include="model\projects\IProjectController.cs" />
+ <Compile Include="model\projects\Project.cs" />
+ <Compile Include="model\projects\ProjectController.cs" />
+ <Compile Include="model\projects\ProjectControllerSpecs.cs" />
+ <Compile Include="model\reporting\IReport.cs" />
+ <Compile Include="model\reporting\ReportBindingExtensions.cs" />
+ <Compile Include="model\reporting\ReportBindingExtensionsSpecs.cs" />
+ <Compile Include="presenters\AddCompanyPresenter.cs" />
+ <Compile Include="presenters\AddCompanyPresenterSpecs.cs" />
+ <Compile Include="presenters\AddBillPaymentPresenter.cs" />
+ <Compile Include="presenters\IRunPresenterCommand.cs" />
+ <Compile Include="presenters\ViewAllBillsPresenter.cs" />
+ <Compile Include="presenters\RestartCommand.cs" />
+ <Compile Include="presenters\RunPresenterCommand.cs" />
+ <Compile Include="presenters\RunThe.cs" />
+ <Compile Include="presenters\RunTheSpecs.cs" />
+ <Compile Include="model\excel\Cell.cs" />
+ <Compile Include="model\excel\ChangeFontSize.cs" />
+ <Compile Include="model\excel\CompositeCellVisitor.cs" />
+ <Compile Include="model\excel\ConstrainedCellVisitor.cs" />
+ <Compile Include="model\excel\ExcelUsage.cs" />
+ <Compile Include="model\excel\FormatBackColor.cs" />
+ <Compile Include="model\excel\ICell.cs" />
+ <Compile Include="model\excel\ICellInterior.cs" />
+ <Compile Include="model\excel\ICellVisitor.cs" />
+ <Compile Include="presenters\AddNewIncomePresenter.cs" />
+ <Compile Include="presenters\AddNewIncomePresenterSpecs.cs" />
+ <Compile Include="presenters\ViewIncomeHistoryPresenter.cs" />
+ <Compile Include="presenters\AboutTheApplicationPresenter.cs" />
+ <Compile Include="presenters\ApplicationMenuPresenter.cs" />
+ <Compile Include="presenters\AddBillingTaskPane.cs" />
+ <Compile Include="presenters\AddCompanyTaskPane.cs" />
+ <Compile Include="presenters\AddIncomeTaskPane.cs" />
+ <Compile Include="presenters\AddReportingTaskPane.cs" />
+ <Compile Include="presenters\Build.cs" />
+ <Compile Include="presenters\ExpandoBuilder.cs" />
+ <Compile Include="presenters\ExpandoItemBuilder.cs" />
+ <Compile Include="presenters\IActionTaskPaneFactory.cs" />
+ <Compile Include="presenters\MainMenuPresenter.cs" />
+ <Compile Include="presenters\NavigationPresenter.cs" />
+ <Compile Include="presenters\NavigationPresenterSpecs.cs" />
+ <Compile Include="presenters\ReportPresenter.cs" />
+ <Compile Include="presenters\ApplicationShellPresenter.cs" />
+ <Compile Include="presenters\GettingStartedPresenter.cs" />
+ <Compile Include="presenters\GettingStartedPresenterSpecs.cs" />
+ <Compile Include="presenters\LogFilePresenter.cs" />
+ <Compile Include="presenters\LogFileViewPresenterSpecs.cs" />
+ <Compile Include="presenters\NotificationIconPresenter.cs" />
+ <Compile Include="presenters\NotificationIconPresenterSpecs.cs" />
+ <Compile Include="presenters\NotificationPresenter.cs" />
+ <Compile Include="presenters\StatusBarPresenter.cs" />
+ <Compile Include="presenters\StatusBarPresenterSpecs.cs" />
+ <Compile Include="presenters\TaskTrayPresenter.cs" />
+ <Compile Include="presenters\TitleBarPresenter.cs" />
+ <Compile Include="presenters\TitleBarPresenterSpecs.cs" />
+ <Compile Include="presenters\ToolBarPresenter.cs" />
+ <Compile Include="presenters\UnhandledErrorPresenter.cs" />
+ <Compile Include="presenters\UnhandledErrorPresenterSpecs.cs" />
+ <Compile Include="presenters\DisplayTheSplashScreen.cs" />
+ <Compile Include="presenters\hide_the_splash_screen.cs" />
+ <Compile Include="presenters\ISplashScreenState.cs" />
+ <Compile Include="presenters\SplashScreenPresenter.cs" />
+ <Compile Include="presenters\SplashScreenPresenterSpecs.cs" />
+ <Compile Include="presenters\CheckForUpdatesPresenter.cs" />
+ <Compile Include="presenters\CheckForUpdatesPresenterSpecs.cs" />
+ <Compile Include="presenters\ProcessQueryCommand.cs" />
+ <Compile Include="views\ISelectFileToOpenDialog.cs" />
+ <Compile Include="views\ISelectFileToSaveToDialog.cs" />
+ <Compile Include="views\ITaskTrayMessageView.cs" />
+ <Compile Include="views\ITitleBar.cs" />
+ <Compile Include="views\IViewAllBillsReport.cs" />
+ <Compile Include="views\IApplicationDockedWindow.cs" />
+ <Compile Include="views\IApplicationWindow.cs" />
+ <Compile Include="views\IViewAllIncomeReport.cs" />
+ <Compile Include="winforms\resources\ApplicationIcons.cs" />
+ <Compile Include="winforms\resources\ApplicationImages.cs" />
+ <Compile Include="presenters\RunQueryCommand.cs" />
+ <Compile Include="winforms\views\AddCompanyView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\AddCompanyView.Designer.cs">
+ <Compile Include="winforms\views\AddCompanyView.Designer.cs">
<DependentUpon>AddCompanyView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\AddBillPaymentView.cs">
+ <Compile Include="winforms\views\AddBillPaymentView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\AddBillPaymentView.Designer.cs">
+ <Compile Include="winforms\views\AddBillPaymentView.Designer.cs">
<DependentUpon>AddBillPaymentView.cs</DependentUpon>
</Compile>
- <Compile Include="Views\IAddBillPaymentView.cs" />
- <Compile Include="Views\IViewAllBills.cs" />
- <Compile Include="Winforms\Views\ViewAllIncomesReport.cs">
+ <Compile Include="views\IAddBillPaymentView.cs" />
+ <Compile Include="views\IViewAllBills.cs" />
+ <Compile Include="winforms\views\ViewAllIncomesReport.cs">
<SubType>Component</SubType>
</Compile>
- <Compile Include="Winforms\Views\ViewAllIncomesReport.Designer.cs">
+ <Compile Include="winforms\views\ViewAllIncomesReport.Designer.cs">
<DependentUpon>ViewAllIncomesReport.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ViewAllBills.cs">
+ <Compile Include="winforms\views\ViewAllBills.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ViewAllBills.Designer.cs">
+ <Compile Include="winforms\views\ViewAllBills.Designer.cs">
<DependentUpon>ViewAllBills.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ViewAllBillsReport.cs">
+ <Compile Include="winforms\views\ViewAllBillsReport.cs">
<SubType>Component</SubType>
</Compile>
- <Compile Include="Winforms\Views\ViewAllBillsReport.Designer.cs">
+ <Compile Include="winforms\views\ViewAllBillsReport.Designer.cs">
<DependentUpon>ViewAllBillsReport.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ApplicationDockedWindow.cs">
+ <Compile Include="winforms\views\ApplicationDockedWindow.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ApplicationDockedWindow.Designer.cs">
+ <Compile Include="winforms\views\ApplicationDockedWindow.Designer.cs">
<DependentUpon>ApplicationDockedWindow.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ApplicationWindow.cs">
+ <Compile Include="winforms\views\ApplicationWindow.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ApplicationWindow.Designer.cs">
+ <Compile Include="winforms\views\ApplicationWindow.Designer.cs">
<DependentUpon>ApplicationWindow.cs</DependentUpon>
</Compile>
- <Compile Include="Views\ControlAction.cs" />
- <Compile Include="Views\ICommandDialog.cs" />
- <Compile Include="Views\IDialogLauncher.cs" />
- <Compile Include="Views\IDockedContentView.cs" />
- <Compile Include="Views\IView.cs" />
- <Compile Include="Views\IWindowEvents.cs" />
- <Compile Include="Views\ISaveChangesView.cs" />
- <Compile Include="Winforms\Views\SaveChangesView.cs">
+ <Compile Include="views\ControlAction.cs" />
+ <Compile Include="views\ICommandDialog.cs" />
+ <Compile Include="views\IDialogLauncher.cs" />
+ <Compile Include="views\IDockedContentView.cs" />
+ <Compile Include="views\IView.cs" />
+ <Compile Include="views\IWindowEvents.cs" />
+ <Compile Include="views\ISaveChangesView.cs" />
+ <Compile Include="winforms\views\SaveChangesView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\SaveChangesView.Designer.cs">
+ <Compile Include="winforms\views\SaveChangesView.Designer.cs">
<DependentUpon>SaveChangesView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\SaveChangesViewSpecs.cs" />
- <Compile Include="Winforms\Views\SelectFileToOpenDialog.cs" />
- <Compile Include="Winforms\Views\SelectFileToSaveToDialog.cs" />
- <Compile Include="Views\IAddCompanyView.cs" />
- <Compile Include="Winforms\Views\AddNewIncomeView.cs">
+ <Compile Include="winforms\views\SaveChangesViewSpecs.cs" />
+ <Compile Include="winforms\views\SelectFileToOpenDialog.cs" />
+ <Compile Include="winforms\views\SelectFileToSaveToDialog.cs" />
+ <Compile Include="views\IAddCompanyView.cs" />
+ <Compile Include="winforms\views\AddNewIncomeView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\AddNewIncomeView.Designer.cs">
+ <Compile Include="winforms\views\AddNewIncomeView.Designer.cs">
<DependentUpon>AddNewIncomeView.cs</DependentUpon>
</Compile>
- <Compile Include="Views\IAddNewIncomeView.cs" />
- <Compile Include="Views\IViewIncomeHistory.cs" />
- <Compile Include="Winforms\Views\ViewAllIncome.cs">
+ <Compile Include="views\IAddNewIncomeView.cs" />
+ <Compile Include="views\IViewIncomeHistory.cs" />
+ <Compile Include="winforms\views\ViewAllIncome.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ViewAllIncome.Designer.cs">
+ <Compile Include="winforms\views\ViewAllIncome.Designer.cs">
<DependentUpon>ViewAllIncome.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\AboutTheApplicationView.cs">
+ <Compile Include="winforms\views\AboutTheApplicationView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\AboutTheApplicationView.Designer.cs">
+ <Compile Include="winforms\views\AboutTheApplicationView.Designer.cs">
<DependentUpon>AboutTheApplicationView.cs</DependentUpon>
</Compile>
- <Compile Include="Views\IAboutApplicationView.cs" />
- <Compile Include="Views\IMainMenuView.cs" />
- <Compile Include="Views\INavigationView.cs" />
- <Compile Include="Winforms\Views\MainMenuView.cs">
+ <Compile Include="views\IAboutApplicationView.cs" />
+ <Compile Include="views\IMainMenuView.cs" />
+ <Compile Include="views\INavigationView.cs" />
+ <Compile Include="winforms\views\MainMenuView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\MainMenuView.Designer.cs">
+ <Compile Include="winforms\views\MainMenuView.Designer.cs">
<DependentUpon>MainMenuView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\NavigationView.cs">
+ <Compile Include="winforms\views\NavigationView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\NavigationView.Designer.cs">
+ <Compile Include="winforms\views\NavigationView.Designer.cs">
<DependentUpon>NavigationView.cs</DependentUpon>
</Compile>
- <Compile Include="Views\IReportViewer.cs" />
- <Compile Include="Winforms\Views\ReportViewer.cs">
+ <Compile Include="views\IReportViewer.cs" />
+ <Compile Include="winforms\views\ReportViewer.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ReportViewer.Designer.cs">
+ <Compile Include="winforms\views\ReportViewer.Designer.cs">
<DependentUpon>ReportViewer.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ApplicationShell.cs">
+ <Compile Include="winforms\views\ApplicationShell.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\ApplicationShell.Designer.cs">
+ <Compile Include="winforms\views\ApplicationShell.Designer.cs">
<DependentUpon>ApplicationShell.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\ApplicationShellSpecs.cs" />
- <Compile Include="Views\IGettingStartedView.cs" />
- <Compile Include="Views\ILogFileView.cs" />
- <Compile Include="Views\INotificationIconView.cs" />
- <Compile Include="Views\IRegionManager.cs" />
- <Compile Include="Views\IShell.cs" />
- <Compile Include="Views\IStatusBarView.cs" />
- <Compile Include="Views\IUnhandledErrorView.cs" />
- <Compile Include="Winforms\Views\LogFileView.cs">
+ <Compile Include="winforms\views\ApplicationShellSpecs.cs" />
+ <Compile Include="views\IGettingStartedView.cs" />
+ <Compile Include="views\ILogFileView.cs" />
+ <Compile Include="views\INotificationIconView.cs" />
+ <Compile Include="views\IRegionManager.cs" />
+ <Compile Include="views\IShell.cs" />
+ <Compile Include="views\IStatusBarView.cs" />
+ <Compile Include="views\IUnhandledErrorView.cs" />
+ <Compile Include="winforms\views\LogFileView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\LogFileView.Designer.cs">
+ <Compile Include="winforms\views\LogFileView.Designer.cs">
<DependentUpon>LogFileView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\NotificationIconView.cs" />
- <Compile Include="Winforms\Views\StatusBarView.cs" />
- <Compile Include="Winforms\Views\TaskTrayMessage.cs" />
- <Compile Include="Winforms\Views\TitleBar.cs" />
- <Compile Include="Winforms\Views\UnhandledErrorView.cs">
+ <Compile Include="winforms\views\NotificationIconView.cs" />
+ <Compile Include="winforms\views\StatusBarView.cs" />
+ <Compile Include="winforms\views\TaskTrayMessage.cs" />
+ <Compile Include="winforms\views\TitleBar.cs" />
+ <Compile Include="winforms\views\UnhandledErrorView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\UnhandledErrorView.Designer.cs">
+ <Compile Include="winforms\views\UnhandledErrorView.Designer.cs">
<DependentUpon>UnhandledErrorView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\WelcomeScreen.cs">
+ <Compile Include="winforms\views\WelcomeScreen.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\WelcomeScreen.Designer.cs">
+ <Compile Include="winforms\views\WelcomeScreen.Designer.cs">
<DependentUpon>WelcomeScreen.cs</DependentUpon>
</Compile>
- <Compile Include="Views\ISplashScreenView.cs" />
- <Compile Include="Winforms\Views\SplashScreenView.cs">
+ <Compile Include="views\ISplashScreenView.cs" />
+ <Compile Include="winforms\views\SplashScreenView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\SplashScreenView.Designer.cs">
+ <Compile Include="winforms\views\SplashScreenView.Designer.cs">
<DependentUpon>SplashScreenView.cs</DependentUpon>
</Compile>
- <Compile Include="Winforms\Views\CheckForUpdatesView.cs">
+ <Compile Include="winforms\views\CheckForUpdatesView.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Winforms\Views\CheckForUpdatesView.Designer.cs">
+ <Compile Include="winforms\views\CheckForUpdatesView.Designer.cs">
<DependentUpon>CheckForUpdatesView.cs</DependentUpon>
</Compile>
- <Compile Include="Views\ICheckForUpdatesView.cs" />
- <Compile Include="Winforms\Databinding\BindingSelector.cs" />
- <Compile Include="Winforms\Databinding\BindingSelectorSpecs.cs" />
- <Compile Include="Winforms\Databinding\ComboBoxDataBindingSpecs.cs" />
- <Compile Include="Winforms\Databinding\ComboBoxPropertyBinding.cs" />
- <Compile Include="Winforms\Databinding\ControlBindingExtensions.cs" />
- <Compile Include="Winforms\Databinding\Create.cs" />
- <Compile Include="Winforms\Databinding\CreateSpecs.cs" />
- <Compile Include="Winforms\Databinding\DateTimePickerPropertyBinding.cs" />
- <Compile Include="Winforms\Databinding\DateTimePropertyBindingSpecs.cs" />
- <Compile Include="Winforms\Databinding\IPropertyBinding.cs" />
- <Compile Include="Winforms\Databinding\ListboxExtensions.cs" />
- <Compile Include="Winforms\Databinding\PropertyBinder.cs" />
- <Compile Include="Winforms\Databinding\PropertyBinderSpecs.cs" />
- <Compile Include="Winforms\Databinding\PropertyInspector.cs" />
- <Compile Include="Winforms\Databinding\PropertyInspectorFactory.cs" />
- <Compile Include="Winforms\Databinding\PropertyInspectorSpecs.cs" />
- <Compile Include="Winforms\Databinding\TextBoxDataBindingSpecs.cs" />
- <Compile Include="Winforms\Databinding\TextBoxExtensions.cs" />
- <Compile Include="Winforms\Databinding\TextPropertyBinding.cs" />
- <Compile Include="Winforms\Helpers\BindableListBox.cs" />
- <Compile Include="Winforms\Helpers\BindableListBoxSpecs.cs" />
- <Compile Include="Winforms\Helpers\BindableListExtensions.cs" />
- <Compile Include="Winforms\Helpers\BindableListFactory.cs" />
- <Compile Include="Winforms\Helpers\BindableTextBox.cs" />
- <Compile Include="Winforms\Helpers\BindableTextBoxExtensions.cs" />
- <Compile Include="Winforms\Helpers\BindableTextBoxExtensionsSpecs.cs" />
- <Compile Include="Winforms\Helpers\BindableTextBoxSpecs.cs" />
- <Compile Include="Winforms\Helpers\BitmapRegion.cs" />
- <Compile Include="Winforms\Helpers\ButtonExtensions.cs" />
- <Compile Include="Winforms\Helpers\ComboBoxListControl.cs" />
- <Compile Include="Winforms\Helpers\ControlAdapter.cs">
+ <Compile Include="views\ICheckForUpdatesView.cs" />
+ <Compile Include="winforms\databinding\BindingSelector.cs" />
+ <Compile Include="winforms\databinding\BindingSelectorSpecs.cs" />
+ <Compile Include="winforms\databinding\ComboBoxDataBindingSpecs.cs" />
+ <Compile Include="winforms\databinding\ComboBoxPropertyBinding.cs" />
+ <Compile Include="winforms\databinding\ControlBindingExtensions.cs" />
+ <Compile Include="winforms\databinding\Create.cs" />
+ <Compile Include="winforms\databinding\CreateSpecs.cs" />
+ <Compile Include="winforms\databinding\DateTimePickerPropertyBinding.cs" />
+ <Compile Include="winforms\databinding\DateTimePropertyBindingSpecs.cs" />
+ <Compile Include="winforms\databinding\IPropertyBinding.cs" />
+ <Compile Include="winforms\databinding\ListboxExtensions.cs" />
+ <Compile Include="winforms\databinding\PropertyBinder.cs" />
+ <Compile Include="winforms\databinding\PropertyBinderSpecs.cs" />
+ <Compile Include="winforms\databinding\PropertyInspector.cs" />
+ <Compile Include="winforms\databinding\PropertyInspectorFactory.cs" />
+ <Compile Include="winforms\databinding\PropertyInspectorSpecs.cs" />
+ <Compile Include="winforms\databinding\TextBoxDataBindingSpecs.cs" />
+ <Compile Include="winforms\databinding\TextBoxExtensions.cs" />
+ <Compile Include="winforms\databinding\TextPropertyBinding.cs" />
+ <Compile Include="winforms\helpers\BindableListBox.cs" />
+ <Compile Include="winforms\helpers\BindableListBoxSpecs.cs" />
+ <Compile Include="winforms\helpers\BindableListExtensions.cs" />
+ <Compile Include="winforms\helpers\BindableListFactory.cs" />
+ <Compile Include="winforms\helpers\BindableTextBox.cs" />
+ <Compile Include="winforms\helpers\BindableTextBoxExtensions.cs" />
+ <Compile Include="winforms\helpers\BindableTextBoxExtensionsSpecs.cs" />
+ <Compile Include="winforms\helpers\BindableTextBoxSpecs.cs" />
+ <Compile Include="winforms\helpers\BitmapRegion.cs" />
+ <Compile Include="winforms\helpers\ButtonExtensions.cs" />
+ <Compile Include="winforms\helpers\ComboBoxListControl.cs" />
+ <Compile Include="winforms\helpers\ControlAdapter.cs">
<SubType>Component</SubType>
</Compile>
- <Compile Include="Winforms\Helpers\ControlExtensions.cs" />
- <Compile Include="Winforms\Helpers\Events.cs" />
- <Compile Include="Winforms\Helpers\EventTrigger.cs" />
- <Compile Include="Winforms\Helpers\EventTriggerExtensions.cs" />
- <Compile Include="Winforms\Helpers\EventTriggerSpecs.cs" />
- <Compile Include="Winforms\Helpers\IBindableList.cs" />
- <Compile Include="Winforms\Helpers\IEventTarget.cs" />
- <Compile Include="Winforms\Helpers\IListControl.cs" />
- <Compile Include="Winforms\Helpers\ITextBoxCommand.cs" />
- <Compile Include="Winforms\Helpers\ITextControl.cs" />
- <Compile Include="Winforms\Helpers\ListBoxListControl.cs" />
- <Compile Include="Winforms\Helpers\RebindTextBoxCommand.cs" />
- <Compile Include="Winforms\Helpers\RebindTextBoxCommandSpecs.cs" />
- <Compile Include="Winforms\Helpers\SuspendLayout.cs" />
- <Compile Include="Winforms\Helpers\TextControl.cs" />
- <Compile Include="Winforms\Helpers\TextControlSpecs.cs" />
- <Compile Include="Winforms\Keyboard\ShortcutKey.cs" />
- <Compile Include="Winforms\Keyboard\ShortcutKeys.cs" />
- <Compile Include="Winforms\Krypton\BindableListExtensions.cs" />
- <Compile Include="Winforms\Krypton\KryptonComboBoxListControl.cs" />
- <Compile Include="Winforms\Krypton\KryptonListBoxListControl.cs" />
- <Compile Include="Winforms\Krypton\KryptonTextControl.cs" />
- <Compile Include="Winforms\Krypton\ListboxExtensions.cs" />
- <Compile Include="Winforms\Krypton\TextBoxExtensions.cs" />
- <Compile Include="Winforms\Resources\ApplicationIcon.cs" />
- <Compile Include="Winforms\Resources\ApplicationImage.cs" />
- <Compile Include="Winforms\Resources\HybridIcon.cs" />
+ <Compile Include="winforms\helpers\ControlExtensions.cs" />
+ <Compile Include="winforms\helpers\Events.cs" />
+ <Compile Include="winforms\helpers\EventTrigger.cs" />
+ <Compile Include="winforms\helpers\EventTriggerExtensions.cs" />
+ <Compile Include="winforms\helpers\EventTriggerSpecs.cs" />
+ <Compile Include="winforms\helpers\IBindableList.cs" />
+ <Compile Include="winforms\helpers\IEventTarget.cs" />
+ <Compile Include="winforms\helpers\IListControl.cs" />
+ <Compile Include="winforms\helpers\ITextBoxCommand.cs" />
+ <Compile Include="winforms\helpers\ITextControl.cs" />
+ <Compile Include="winforms\helpers\ListBoxListControl.cs" />
+ <Compile Include="winforms\helpers\RebindTextBoxCommand.cs" />
+ <Compile Include="winforms\helpers\RebindTextBoxCommandSpecs.cs" />
+ <Compile Include="winforms\helpers\SuspendLayout.cs" />
+ <Compile Include="winforms\helpers\TextControl.cs" />
+ <Compile Include="winforms\helpers\TextControlSpecs.cs" />
+ <Compile Include="winforms\keyboard\ShortcutKey.cs" />
+ <Compile Include="winforms\keyboard\ShortcutKeys.cs" />
+ <Compile Include="winforms\krypton\BindableListExtensions.cs" />
+ <Compile Include="winforms\krypton\KryptonComboBoxListControl.cs" />
+ <Compile Include="winforms\krypton\KryptonListBoxListControl.cs" />
+ <Compile Include="winforms\krypton\KryptonTextControl.cs" />
+ <Compile Include="winforms\krypton\ListboxExtensions.cs" />
+ <Compile Include="winforms\krypton\TextBoxExtensions.cs" />
+ <Compile Include="winforms\resources\ApplicationIcon.cs" />
+ <Compile Include="winforms\resources\ApplicationImage.cs" />
+ <Compile Include="winforms\resources\HybridIcon.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\licenses.licx" />
- <EmbeddedResource Include="Winforms\Views\AddCompanyView.resx">
+ <EmbeddedResource Include="winforms\views\AddCompanyView.resx">
<DependentUpon>AddCompanyView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\AddBillPaymentView.resx">
+ <EmbeddedResource Include="winforms\views\AddBillPaymentView.resx">
<DependentUpon>AddBillPaymentView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ViewAllIncomesReport.resx">
+ <EmbeddedResource Include="winforms\views\ViewAllIncomesReport.resx">
<DependentUpon>ViewAllIncomesReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ViewAllBills.resx">
+ <EmbeddedResource Include="winforms\views\ViewAllBills.resx">
<DependentUpon>ViewAllBills.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ViewAllBillsReport.resx">
+ <EmbeddedResource Include="winforms\views\ViewAllBillsReport.resx">
<DependentUpon>ViewAllBillsReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ApplicationWindow.resx">
+ <EmbeddedResource Include="winforms\views\ApplicationWindow.resx">
<DependentUpon>ApplicationWindow.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\SaveChangesView.resx">
+ <EmbeddedResource Include="winforms\views\SaveChangesView.resx">
<DependentUpon>SaveChangesView.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\AddNewIncomeView.resx">
+ <EmbeddedResource Include="winforms\views\AddNewIncomeView.resx">
<DependentUpon>AddNewIncomeView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ViewAllIncome.resx">
+ <EmbeddedResource Include="winforms\views\ViewAllIncome.resx">
<DependentUpon>ViewAllIncome.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\AboutTheApplicationView.resx">
+ <EmbeddedResource Include="winforms\views\AboutTheApplicationView.resx">
<DependentUpon>AboutTheApplicationView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\MainMenuView.resx">
+ <EmbeddedResource Include="winforms\views\MainMenuView.resx">
<DependentUpon>MainMenuView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\NavigationView.resx">
+ <EmbeddedResource Include="winforms\views\NavigationView.resx">
<DependentUpon>NavigationView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ReportViewer.resx">
+ <EmbeddedResource Include="winforms\views\ReportViewer.resx">
<DependentUpon>ReportViewer.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\ApplicationShell.resx">
+ <EmbeddedResource Include="winforms\views\ApplicationShell.resx">
<DependentUpon>ApplicationShell.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\LogFileView.resx">
+ <EmbeddedResource Include="winforms\views\LogFileView.resx">
<DependentUpon>LogFileView.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\UnhandledErrorView.resx">
+ <EmbeddedResource Include="winforms\views\UnhandledErrorView.resx">
<DependentUpon>UnhandledErrorView.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\WelcomeScreen.resx">
+ <EmbeddedResource Include="winforms\views\WelcomeScreen.resx">
<DependentUpon>WelcomeScreen.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\SplashScreenView.resx">
+ <EmbeddedResource Include="winforms\views\SplashScreenView.resx">
<DependentUpon>SplashScreenView.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Winforms\Views\CheckForUpdatesView.resx">
+ <EmbeddedResource Include="winforms\views\CheckForUpdatesView.resx">
<DependentUpon>CheckForUpdatesView.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\DTO\DTO.csproj">
+ <ProjectReference Include="..\DTO\dto.csproj">
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
- <Name>DTO</Name>
+ <Name>dto</Name>
</ProjectReference>
- <ProjectReference Include="..\Service.Contracts\Service.Contracts.csproj">
+ <ProjectReference Include="..\Service.Contracts\service.contracts.csproj">
<Project>{41D2B68B-031B-44FF-BAC5-7752D9E29F94}</Project>
- <Name>Service.Contracts</Name>
+ <Name>service.contracts</Name>
</ProjectReference>
- <ProjectReference Include="..\Service\Service.csproj">
+ <ProjectReference Include="..\Service\service.csproj">
<Project>{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}</Project>
- <Name>Service</Name>
- </ProjectReference>
- <ProjectReference Include="..\utility\utility.csproj">
- <Project>{22DF610D-CBC8-4042-A470-ABF246C5DDD4}</Project>
- <Name>utility</Name>
+ <Name>service</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
product/Service/Application/AddNewIncomeCommand.cs
@@ -1,6 +1,5 @@
using System.Linq;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Core;
using MoMoney.Domain.repositories;
using MoMoney.DTO;
@@ -10,15 +9,15 @@ namespace MoMoney.Service.Application
{
public class AddNewIncomeCommand : IAddNewIncomeCommand
{
- readonly IGetTheCurrentCustomerQuery tasks;
- readonly INotification notification;
+ readonly IGetTheCurrentCustomerQuery query;
+ readonly Notification notification;
readonly IIncomeRepository all_income;
readonly ICompanyRepository companys;
- public AddNewIncomeCommand(IGetTheCurrentCustomerQuery tasks, INotification notification, IIncomeRepository all_income,
+ public AddNewIncomeCommand(IGetTheCurrentCustomerQuery query, Notification notification, IIncomeRepository all_income,
ICompanyRepository companys)
{
- this.tasks = tasks;
+ this.query = query;
this.notification = notification;
this.all_income = all_income;
this.companys = companys;
@@ -35,7 +34,7 @@ namespace MoMoney.Service.Application
companys
.find_company_by(item.company_id)
.pay(
- tasks.fetch(),
+ query.fetch(),
item.amount.as_money(),
item.recieved_date
);
product/Service/Application/AddNewIncomeCommandSpecs.cs
@@ -1,8 +1,8 @@
using System;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.Core;
using MoMoney.Domain.repositories;
@@ -11,22 +11,20 @@ using MoMoney.Service.Contracts.Application;
namespace MoMoney.Service.Application
{
- public class AddNewIncomeCommandSpecs
- {
- }
+ public class AddNewIncomeCommandSpecs {}
[Concern(typeof (AddNewIncomeCommand))]
public abstract class when_adding_a_new_income : concerns_for<IAddNewIncomeCommand, AddNewIncomeCommand>
{
context c = () =>
- {
- notification = the_dependency<INotification>();
- tasks = the_dependency<IGetTheCurrentCustomerQuery>();
- all_income = the_dependency<IIncomeRepository>();
- companies = the_dependency<ICompanyRepository>();
- };
+ {
+ notification = the_dependency<Notification>();
+ tasks = the_dependency<IGetTheCurrentCustomerQuery>();
+ all_income = the_dependency<IIncomeRepository>();
+ companies = the_dependency<ICompanyRepository>();
+ };
- static protected INotification notification;
+ static protected Notification notification;
static protected IGetTheCurrentCustomerQuery tasks;
static protected IIncomeRepository all_income;
static protected ICompanyRepository companies;
@@ -39,25 +37,25 @@ namespace MoMoney.Service.Application
() => notification.was_told_to(x => x.notify("You have already submitted this income"));
context c = () =>
- {
- var a_company = an<ICompany>();
- var matching_income = an<IIncome>();
- var today = new Date(2008, 12, 26);
- Id<Guid> id = Guid.NewGuid();
+ {
+ var a_company = an<ICompany>();
+ var matching_income = an<IIncome>();
+ var today = new Date(2008, 12, 26);
+ Id<Guid> id = Guid.NewGuid();
- income = new IncomeSubmissionDTO
- {
- amount = 100.00,
- company_id = id,
- recieved_date = today,
- };
+ income = new IncomeSubmissionDTO
+ {
+ amount = 100.00,
+ company_id = id,
+ recieved_date = today,
+ };
- when_the(matching_income).is_asked_for(x => x.amount_tendered).it_will_return(100.as_money());
- when_the(matching_income).is_asked_for(x => x.company).it_will_return(a_company);
- when_the(matching_income).is_asked_for(x => x.date_of_issue).it_will_return(today);
- when_the(a_company).is_asked_for(x => x.id).it_will_return(id);
- when_the(all_income).is_told_to(x => x.all()).it_will_return(matching_income);
- };
+ when_the(matching_income).is_asked_for(x => x.amount_tendered).it_will_return(100.as_money());
+ when_the(matching_income).is_asked_for(x => x.company).it_will_return(a_company);
+ when_the(matching_income).is_asked_for(x => x.date_of_issue).it_will_return(today);
+ when_the(a_company).is_asked_for(x => x.id).it_will_return(id);
+ when_the(all_income).is_told_to(x => x.all()).it_will_return(matching_income);
+ };
because b = () => sut.run(income);
product/Service/Application/EventLog.cs
@@ -1,13 +1,13 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Application
{
public class EventLog : IEventLog
{
- readonly IList<ICommand> events = new List<ICommand>();
+ readonly IList<Command> events = new List<Command>();
- public void process(ICommand the_event)
+ public void process(Command the_event)
{
the_event.run();
events.Add(the_event);
product/Service/Application/GetAllBillsQuery.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
using MoMoney.DTO;
@@ -11,9 +10,9 @@ namespace MoMoney.Service.Application
public class GetAllBillsQuery : IGetAllBillsQuery
{
readonly IBillRepository bills;
- readonly IMapper<IBill, BillInformationDTO> mapper;
+ readonly Mapper<IBill, BillInformationDTO> mapper;
- public GetAllBillsQuery(IBillRepository bills, IMapper<IBill, BillInformationDTO> mapper)
+ public GetAllBillsQuery(IBillRepository bills, Mapper<IBill, BillInformationDTO> mapper)
{
this.bills = bills;
this.mapper = mapper;
product/Service/Application/GetAllCompanysQuery.cs
@@ -1,7 +1,5 @@
using System.Collections.Generic;
-using System.ComponentModel;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
using MoMoney.DTO;
@@ -9,13 +7,12 @@ using MoMoney.Service.Contracts.Application;
namespace MoMoney.Service.Application
{
- [DisplayName("Loading all companies...")]
public class GetAllCompanysQuery : IGetAllCompanysQuery
{
readonly ICompanyRepository companys;
- readonly IMapper<ICompany, CompanyDTO> mapper;
+ readonly Mapper<ICompany, CompanyDTO> mapper;
- public GetAllCompanysQuery(ICompanyRepository companys, IMapper<ICompany, CompanyDTO> mapper)
+ public GetAllCompanysQuery(ICompanyRepository companys, Mapper<ICompany, CompanyDTO> mapper)
{
this.companys = companys;
this.mapper = mapper;
product/Service/Application/GetAllIncomeQuery.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
using MoMoney.DTO;
@@ -11,9 +10,9 @@ namespace MoMoney.Service.Application
public class GetAllIncomeQuery : IGetAllIncomeQuery
{
readonly IIncomeRepository all_income;
- readonly IMapper<IIncome, IncomeInformationDTO> mapper;
+ readonly Mapper<IIncome, IncomeInformationDTO> mapper;
- public GetAllIncomeQuery(IIncomeRepository all_income, IMapper<IIncome, IncomeInformationDTO> mapper)
+ public GetAllIncomeQuery(IIncomeRepository all_income, Mapper<IIncome, IncomeInformationDTO> mapper)
{
this.all_income = all_income;
this.mapper = mapper;
product/Service/Application/GetTheCurrentCustomerQuery.cs
@@ -1,13 +1,11 @@
using System.Linq;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.Domain.accounting;
using MoMoney.Domain.repositories;
namespace MoMoney.Service.Application
{
- public interface IGetTheCurrentCustomerQuery : IQuery<IAccountHolder>
- {
- }
+ public interface IGetTheCurrentCustomerQuery : Query<IAccountHolder> {}
public class GetTheCurrentCustomerQuery : IGetTheCurrentCustomerQuery
{
product/Service/Application/IEventLog.cs
@@ -1,9 +1,9 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Application
{
public interface IEventLog
{
- void process(ICommand the_event);
+ void process(Command the_event);
}
}
\ No newline at end of file
product/Service/Application/RegisterNewCompanyCommand.cs
@@ -1,6 +1,5 @@
using System.Linq;
-using Gorilla.Commons.Utility.Core;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
using MoMoney.Domain.Accounting;
using MoMoney.Domain.repositories;
using MoMoney.DTO;
@@ -11,10 +10,10 @@ namespace MoMoney.Service.Application
public class RegisterNewCompanyCommand : IRegisterNewCompanyCommand
{
readonly ICompanyFactory factory;
- readonly INotification notification;
+ readonly Notification notification;
readonly ICompanyRepository companies;
- public RegisterNewCompanyCommand(ICompanyFactory factory, INotification notification,
+ public RegisterNewCompanyCommand(ICompanyFactory factory, Notification notification,
ICompanyRepository companies)
{
this.factory = factory;
product/Service/Infrastructure/Eventing/EventAggregator.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
-using Gorilla.Commons.Utility.Extensions;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Eventing
{
product/Service/Infrastructure/Eventing/EventAggregatorSpecs.cs
@@ -19,7 +19,7 @@ namespace MoMoney.Service.Infrastructure.Eventing
{
it should_notify_all_subscribers_of_the_event = () =>
{
- first_subscriber.was_told_to(x => x.notify(message));
+ first_subscriber.was_told_to<IEventSubscriber<TestEvent>>(x => x.notify(message));
second_subscriber.was_told_to(x => x.notify(message));
};
product/Service/Infrastructure/Security/IsInRole.cs
@@ -1,9 +1,9 @@
using System.Security.Principal;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Security
{
- public class IsInRole : ISpecification<IPrincipal>
+ public class IsInRole : Specification<IPrincipal>
{
readonly Role role;
product/Service/Infrastructure/Security/IsInRoleSpecs.cs
@@ -1,18 +1,18 @@
using System.Security.Principal;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Security
{
public class IsInRoleSpecs
{
public class when_checking_if_a_principal_belongs_to_a_role :
- concerns_for<ISpecification<IPrincipal>, IsInRole>
+ concerns_for<Specification<IPrincipal>, IsInRole>
{
static protected readonly Role administrator_role = new Role("administrators");
- public override ISpecification<IPrincipal> create_sut()
+ public override Specification<IPrincipal> create_sut()
{
return new IsInRole(administrator_role);
}
product/Service/Infrastructure/Threading/AsynchronousCommandProcessor.cs
@@ -2,30 +2,30 @@ using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Threading
{
public class AsynchronousCommandProcessor : ICommandProcessor
{
- readonly Queue<ICommand> queued_commands;
+ readonly Queue<Command> queued_commands;
readonly EventWaitHandle manual_reset;
readonly IList<Thread> worker_threads;
bool keep_working;
public AsynchronousCommandProcessor()
{
- queued_commands = new Queue<ICommand>();
+ queued_commands = new Queue<Command>();
worker_threads = new List<Thread>();
manual_reset = new ManualResetEvent(false);
}
public void add(Expression<Action> action_to_process)
{
- add(new ActionCommand(action_to_process));
+ add(new AnonymousCommand(action_to_process));
}
- public void add(ICommand command_to_process)
+ public void add(Command command_to_process)
{
lock (queued_commands)
{
@@ -64,7 +64,7 @@ namespace MoMoney.Service.Infrastructure.Threading
void run_next_command()
{
- ICommand command;
+ Command command;
lock (queued_commands)
{
if (queued_commands.Count == 0)
product/Service/Infrastructure/Threading/BackgroundThread.cs
@@ -1,20 +1,16 @@
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
- public interface IBackgroundThread : IDisposableCommand
- {
- }
+ public interface IBackgroundThread : DisposableCommand {}
public class BackgroundThread : IBackgroundThread
{
readonly IWorkerThread worker_thread;
- public BackgroundThread(IDisposableCommand command_to_execute) : this(command_to_execute, new WorkerThread())
- {
- }
+ public BackgroundThread(DisposableCommand command_to_execute) : this(command_to_execute, new WorkerThread()) {}
- public BackgroundThread(IDisposableCommand command_to_execute, IWorkerThread worker_thread)
+ public BackgroundThread(DisposableCommand command_to_execute, IWorkerThread worker_thread)
{
this.worker_thread = worker_thread;
worker_thread.DoWork += (sender, e) => command_to_execute.run();
product/Service/Infrastructure/Threading/BackgroundThreadFactory.cs
@@ -1,33 +1,49 @@
using System;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public interface IBackgroundThreadFactory
{
- IBackgroundThread create_for<CommandToExecute>() where CommandToExecute : IDisposableCommand;
+ IBackgroundThread create_for<CommandToExecute>() where CommandToExecute : DisposableCommand;
IBackgroundThread create_for(Action action);
}
public class BackgroundThreadFactory : IBackgroundThreadFactory
{
- private readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
- public BackgroundThreadFactory(IDependencyRegistry registry)
+ public BackgroundThreadFactory(DependencyRegistry registry)
{
this.registry = registry;
}
- public IBackgroundThread create_for<CommandToExecute>() where CommandToExecute : IDisposableCommand
+ public IBackgroundThread create_for<CommandToExecute>() where CommandToExecute : DisposableCommand
{
return new BackgroundThread(registry.get_a<CommandToExecute>());
}
public IBackgroundThread create_for(Action action)
{
- return new BackgroundThread(new DisposableCommand(action));
+ return new BackgroundThread(new AnonymousDisposableCommand(action));
+ }
+
+ class AnonymousDisposableCommand : DisposableCommand
+ {
+ readonly Action action;
+
+ public AnonymousDisposableCommand(Action action)
+ {
+ this.action = action;
+ }
+
+ public void run()
+ {
+ action();
+ }
+
+ public void Dispose() {}
}
}
}
\ No newline at end of file
product/Service/Infrastructure/Threading/BackgroundThreadFactorySpecs.cs
@@ -1,16 +1,19 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Infrastructure.Container;
using Gorilla.Commons.Testing;
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (BackgroundThreadFactory))]
public abstract class behaves_like_a_background_thread_factory : concerns_for<IBackgroundThreadFactory, BackgroundThreadFactory>
{
- context c = () => { registry = the_dependency<IDependencyRegistry>(); };
+ context c = () =>
+ {
+ registry = the_dependency<DependencyRegistry>();
+ };
- protected static IDependencyRegistry registry;
+ static protected DependencyRegistry registry;
}
[Concern(typeof (BackgroundThreadFactory))]
@@ -19,9 +22,12 @@ namespace MoMoney.Service.Infrastructure.Threading
it should_return_an_instance_of_a_background_thread = () => result.should_not_be_null();
it should_lookup_an_instance_of_the_command_to_execute =
- () => registry.was_told_to(r => r.get_a<IDisposableCommand>());
+ () => registry.was_told_to(r => r.get_a<DisposableCommand>());
- because b = () => { result = sut.create_for<IDisposableCommand>(); };
+ because b = () =>
+ {
+ result = sut.create_for<DisposableCommand>();
+ };
static IBackgroundThread result;
}
product/Service/Infrastructure/Threading/BackgroundThreadSpecs.cs
@@ -1,21 +1,21 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
using Rhino.Mocks;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (BackgroundThread))]
public abstract class behaves_like_a_background_thread : concerns_for<IBackgroundThread, BackgroundThread>
{
context c = () =>
{
- command_to_execute = the_dependency<IDisposableCommand>();
+ command_to_execute = the_dependency<DisposableCommand>();
worker_thread = the_dependency<IWorkerThread>();
};
- protected static IDisposableCommand command_to_execute;
- protected static IWorkerThread worker_thread;
+ static protected DisposableCommand command_to_execute;
+ static protected IWorkerThread worker_thread;
}
[Concern(typeof (BackgroundThread))]
product/Service/Infrastructure/Threading/CommandProcessor.cs
@@ -1,25 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Threading
{
public class CommandProcessor : ICommandProcessor
{
- readonly Queue<ICommand> queued_commands;
+ readonly Queue<Command> queued_commands;
public CommandProcessor()
{
- queued_commands = new Queue<ICommand>();
+ queued_commands = new Queue<Command>();
}
public void add(Expression<Action> action_to_process)
{
- add(new ActionCommand(action_to_process));
+ add(new AnonymousCommand(action_to_process));
}
- public void add(ICommand command_to_process)
+ public void add(Command command_to_process)
{
queued_commands.Enqueue(command_to_process);
}
product/Service/Infrastructure/Threading/CommandProcessorSpecs.cs
@@ -1,13 +1,12 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using MoMoney.Service.Infrastructure.Threading;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (CommandProcessor))]
- public abstract class behaves_like_a_command_processor : concerns_for<ICommandProcessor, CommandProcessor>
- {
- }
+ public abstract class behaves_like_a_command_processor : concerns_for<ICommandProcessor, CommandProcessor> {}
[Concern(typeof (CommandProcessor))]
public class when_running_all_the_queued_commands_waiting_for_execution : behaves_like_a_command_processor
@@ -18,8 +17,8 @@ namespace MoMoney.Service.Infrastructure.Threading
context c = () =>
{
- first_command = an<ICommand>();
- second_command = an<ICommand>();
+ first_command = an<Command>();
+ second_command = an<Command>();
};
because b = () =>
@@ -29,8 +28,8 @@ namespace MoMoney.Service.Infrastructure.Threading
sut.run();
};
- static ICommand first_command;
- static ICommand second_command;
+ static Command first_command;
+ static Command second_command;
}
[Concern(typeof (CommandProcessor))]
@@ -39,7 +38,10 @@ namespace MoMoney.Service.Infrastructure.Threading
it should_not_re_run_the_commands_that_have_already_executed =
() => first_command.was_told_to(f => f.run()).only_once();
- context c = () => { first_command = an<ICommand>(); };
+ context c = () =>
+ {
+ first_command = an<Command>();
+ };
because b = () =>
{
@@ -48,6 +50,6 @@ namespace MoMoney.Service.Infrastructure.Threading
sut.run();
};
- static ICommand first_command;
+ static Command first_command;
}
}
\ No newline at end of file
product/Service/Infrastructure/Threading/ICommandProcessor.cs
@@ -1,13 +1,13 @@
using System;
using System.Linq.Expressions;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
namespace MoMoney.Service.Infrastructure.Threading
{
- public interface ICommandProcessor : ICommand
+ public interface ICommandProcessor : Command
{
void add(Expression<Action> action_to_process);
- void add(ICommand command_to_process);
+ void add(Command command_to_process);
void stop();
}
}
\ No newline at end of file
product/Service/Infrastructure/Threading/IntervalTimer.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Timers;
+using momoney.service.infrastructure.threading;
namespace MoMoney.Service.Infrastructure.Threading
{
product/Service/Infrastructure/Threading/IntervalTimerSpecs.cs
@@ -2,9 +2,10 @@ using System;
using System.Timers;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
+using MoMoney.Service.Infrastructure.Threading;
using Rhino.Mocks;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (IntervalTimer))]
public abstract class behaves_like_an_interval_timer : concerns_for<ITimer, IntervalTimer>
product/Service/Infrastructure/Threading/ITimerClient.cs
@@ -1,4 +1,4 @@
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public interface ITimerClient
{
product/Service/Infrastructure/Threading/IWorkerThread.cs
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public interface IWorkerThread : IDisposable
{
product/Service/Infrastructure/Threading/RaiseEventInterceptor.cs
@@ -1,7 +1,7 @@
using Castle.Core.Interceptor;
using MoMoney.Service.Infrastructure.Eventing;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public interface IRaiseEventInterceptor<Event> : IInterceptor where Event : IEvent, new()
{
product/Service/Infrastructure/Threading/RunOnBackgroundThreadInterceptor.cs
@@ -1,10 +1,10 @@
using Castle.Core.Interceptor;
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public class RunOnBackgroundThreadInterceptor<CommandToExecute> : IInterceptor
- where CommandToExecute : IDisposableCommand
+ where CommandToExecute : DisposableCommand
{
readonly IBackgroundThreadFactory thread_factory;
product/Service/Infrastructure/Threading/RunOnBackgroundThreadInterceptorSpecs.cs
@@ -1,15 +1,18 @@
using Castle.Core.Interceptor;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (RunOnBackgroundThreadInterceptor<>))]
public abstract class behaves_like_background_thread_interceptor :
- concerns_for<IInterceptor, RunOnBackgroundThreadInterceptor<IDisposableCommand>>
+ concerns_for<IInterceptor, RunOnBackgroundThreadInterceptor<DisposableCommand>>
{
- context c = () => { thread_factory = the_dependency<IBackgroundThreadFactory>(); };
+ context c = () =>
+ {
+ thread_factory = the_dependency<IBackgroundThreadFactory>();
+ };
static protected IBackgroundThreadFactory thread_factory;
}
@@ -23,14 +26,14 @@ namespace MoMoney.Service.Infrastructure.Threading
invocation = an<IInvocation>();
background_thread = an<IBackgroundThread>();
thread_factory
- .is_told_to(f => f.create_for<IDisposableCommand>())
+ .is_told_to(f => f.create_for<DisposableCommand>())
.it_will_return(background_thread);
};
because b = () => sut.Intercept(invocation);
it should_display_a_progress_bar_on_a_background_thread =
- () => thread_factory.was_told_to(f => f.create_for<IDisposableCommand>());
+ () => thread_factory.was_told_to(f => f.create_for<DisposableCommand>());
it should_proceed_with_the_orginal_invocation_on_the_actual_object =
() => invocation.was_told_to(i => i.Proceed());
product/Service/Infrastructure/Threading/RunOnUIThread.cs
@@ -1,16 +1,14 @@
using Castle.Core.Interceptor;
-using Gorilla.Commons.Infrastructure;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.infrastructure.thirdparty.Castle.DynamicProxy;
+using gorilla.commons.utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public class RunOnUIThread : IInterceptor
{
readonly ISynchronizationContextFactory factory;
- public RunOnUIThread() : this(Lazy.load<ISynchronizationContextFactory>())
- {
- }
+ public RunOnUIThread() : this(Lazy.load<ISynchronizationContextFactory>()) {}
public RunOnUIThread(ISynchronizationContextFactory factory)
{
@@ -19,7 +17,7 @@ namespace MoMoney.Service.Infrastructure.Threading
public void Intercept(IInvocation invocation)
{
- factory.create().run(new ActionCommand(invocation.Proceed));
+ factory.create().run(new AnonymousCommand(invocation.Proceed));
}
}
}
\ No newline at end of file
product/Service/Infrastructure/Threading/SynchronizationContextFactory.cs
@@ -1,18 +1,16 @@
using System.Threading;
using Gorilla.Commons.Infrastructure.Container;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
- public interface ISynchronizationContextFactory : IFactory<ISynchronizationContext>
- {
- }
+ public interface ISynchronizationContextFactory : Factory<ISynchronizationContext> {}
public class SynchronizationContextFactory : ISynchronizationContextFactory
{
- readonly IDependencyRegistry registry;
+ readonly DependencyRegistry registry;
- public SynchronizationContextFactory(IDependencyRegistry registry)
+ public SynchronizationContextFactory(DependencyRegistry registry)
{
this.registry = registry;
}
product/Service/Infrastructure/Threading/SynchronizedCommand.cs
@@ -1,12 +1,10 @@
using System;
using System.Threading;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
- public interface ISynchronizedCommand : IParameterizedCommand<Action>, IParameterizedCommand<ICommand>
- {
- }
+ public interface ISynchronizedCommand : ParameterizedCommand<Action>, ParameterizedCommand<Command> {}
public class SynchronizedCommand : ISynchronizedCommand
{
@@ -22,7 +20,7 @@ namespace MoMoney.Service.Infrastructure.Threading
context.Post(x => item(), new object());
}
- public void run(ICommand item)
+ public void run(Command item)
{
run(item.run);
}
product/Service/Infrastructure/Threading/SynchronizedContext.cs
@@ -1,11 +1,9 @@
using System.Threading;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
- public interface ISynchronizationContext : IParameterizedCommand<ICommand>
- {
- }
+ public interface ISynchronizationContext : ParameterizedCommand<Command> {}
public class SynchronizedContext : ISynchronizationContext
{
@@ -16,7 +14,7 @@ namespace MoMoney.Service.Infrastructure.Threading
this.context = context;
}
- public void run(ICommand item)
+ public void run(Command item)
{
context.Post(x => item.run(), new object());
//context.Send(x => item.run(), new object());
product/Service/Infrastructure/Threading/Synchronizer.cs
@@ -5,7 +5,7 @@ using System.Diagnostics;
using System.Security.Permissions;
using System.Threading;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[SecurityPermission(SecurityAction.Demand, ControlThread = true)]
public class Synchronizer : ISynchronizeInvoke, IDisposable
@@ -14,7 +14,7 @@ namespace MoMoney.Service.Infrastructure.Threading
public Synchronizer()
{
- worker_thread = new WorkerThread();
+ worker_thread = new WorkerThread(this);
}
public bool InvokeRequired
@@ -55,10 +55,12 @@ namespace MoMoney.Service.Infrastructure.Threading
bool end_loop;
readonly Mutex end_loop_mutex;
readonly AutoResetEvent item_added;
+ Synchronizer synchronizer;
readonly Queue work_item_queue;
- internal WorkerThread()
+ internal WorkerThread(Synchronizer synchronizer)
{
+ this.synchronizer = synchronizer;
end_loop = false;
thread = null;
end_loop_mutex = new Mutex();
@@ -86,7 +88,7 @@ namespace MoMoney.Service.Infrastructure.Threading
}
get
{
- bool result;
+ var result = false;
end_loop_mutex.WaitOne();
result = end_loop;
end_loop_mutex.ReleaseMutex();
product/Service/Infrastructure/Threading/ThreadingExtensions.cs
@@ -1,10 +1,10 @@
-using MoMoney.Utility.Core;
+using gorilla.commons.Utility;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
- public static class ThreadingExtensions
+ static public class ThreadingExtensions
{
- public static IBackgroundThread on_a_background_thread(this IDisposableCommand command)
+ static public IBackgroundThread on_a_background_thread(this DisposableCommand command)
{
return new BackgroundThread(command);
}
product/Service/Infrastructure/Threading/TimerFactory.cs
@@ -1,7 +1,7 @@
using System;
using System.Timers;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public interface ITimerFactory
{
product/Service/Infrastructure/Threading/TimerFactorySpecs.cs
@@ -3,7 +3,7 @@ using System.Timers;
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Concern(typeof (TimerFactory))]
public abstract class behaves_like_a_timer_factory : concerns_for<ITimerFactory, TimerFactory>
product/Service/Infrastructure/Threading/WorkerThread.cs
@@ -2,7 +2,7 @@ using System;
using System.ComponentModel;
using Gorilla.Commons.Infrastructure.Logging;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
public class WorkerThread : Component, IWorkerThread
{
product/Service/Infrastructure/Threading/WorkItem.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading;
-namespace MoMoney.Service.Infrastructure.Threading
+namespace momoney.service.infrastructure.threading
{
[Serializable]
internal class WorkItem : IAsyncResult
product/Service/Infrastructure/Transactions/EmptyUnitOfWork.cs
@@ -1,5 +1,5 @@
using Gorilla.Commons.Infrastructure.Logging;
-using MoMoney.Service.Contracts.Infrastructure.Transactions;
+using momoney.service.contracts.infrastructure.transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Transactions/UnitOfWork.cs
@@ -1,5 +1,5 @@
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Service.Contracts.Infrastructure.Transactions;
+using momoney.database.transactions;
+using momoney.service.contracts.infrastructure.transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Transactions/UnitOfWorkFactory.cs
@@ -1,4 +1,5 @@
-using MoMoney.DataAccess.Transactions;
+using momoney.database.transactions;
+using momoney.service.contracts.infrastructure.transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
product/Service/Infrastructure/Transactions/UnitOfWorkFactorySpecs.cs
@@ -1,6 +1,7 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.DataAccess.Transactions;
+using momoney.database.transactions;
+using momoney.service.contracts.infrastructure.transactions;
using MoMoney.Service.Contracts.Infrastructure.Transactions;
namespace MoMoney.Service.Infrastructure.Transactions
product/Service/Infrastructure/Transactions/UnitOfWorkSpecs.cs
@@ -1,7 +1,7 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.DataAccess.Transactions;
-using MoMoney.Service.Contracts.Infrastructure.Transactions;
+using momoney.database.transactions;
+using momoney.service.contracts.infrastructure.transactions;
namespace MoMoney.Service.Infrastructure.Transactions
{
product/Service/Infrastructure/Updating/CancelUpdate.cs
@@ -1,4 +1,4 @@
-using MoMoney.Service.Contracts.Infrastructure.Updating;
+using momoney.service.contracts.infrastructure.updating;
namespace MoMoney.Service.Infrastructure.Updating
{
product/Service/Infrastructure/Updating/CancelUpdateSpecs.cs
@@ -1,8 +1,9 @@
using developwithpassion.bdd.contexts;
using Gorilla.Commons.Testing;
-using MoMoney.Service.Contracts.Infrastructure.Updating;
+using momoney.service.contracts.infrastructure.updating;
+using MoMoney.Service.Infrastructure.Updating;
-namespace MoMoney.Service.Infrastructure.Updating
+namespace momoney.service.infrastructure.updating
{
public class CancelUpdateSpecs
{
product/Service/Infrastructure/Updating/CurrentDeployment.cs
@@ -1,8 +1,9 @@
using System;
using System.ComponentModel;
using System.Deployment.Application;
+using MoMoney.Service.Infrastructure.Updating;
-namespace MoMoney.Service.Infrastructure.Updating
+namespace momoney.service.infrastructure.updating
{
public class CurrentDeployment : IDeployment
{
product/Service/Infrastructure/Updating/DownloadTheLatestVersion.cs
@@ -1,6 +1,6 @@
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
-using MoMoney.Service.Contracts.Infrastructure.Updating;
+using momoney.service.contracts.infrastructure.updating;
namespace MoMoney.Service.Infrastructure.Updating
{
@@ -13,7 +13,7 @@ namespace MoMoney.Service.Infrastructure.Updating
this.deployment = deployment;
}
- public void run(ICallback<Percent> callback)
+ public void run(Callback<Percent> callback)
{
deployment.UpdateProgressChanged += (o, e) => callback.run(new Percent(e.BytesCompleted, e.BytesTotal));
deployment.UpdateCompleted += (sender, args) => callback.run(100);
product/Service/Infrastructure/Updating/NullDeployment.cs
@@ -2,8 +2,9 @@ using System;
using System.ComponentModel;
using System.Deployment.Application;
using System.Threading;
+using MoMoney.Service.Infrastructure.Updating;
-namespace MoMoney.Service.Infrastructure.Updating
+namespace momoney.service.infrastructure.updating
{
public class NullDeployment : IDeployment
{
product/Service/Infrastructure/ProjectTasks.cs
@@ -1,5 +1,5 @@
using Gorilla.Commons.Infrastructure.FileSystem;
-using MoMoney.DataAccess;
+using momoney.database;
using MoMoney.Service.Contracts.Infrastructure;
namespace MoMoney.Service.Infrastructure
@@ -13,7 +13,7 @@ namespace MoMoney.Service.Infrastructure
this.configuration = configuration;
}
- public void open(IFile file)
+ public void open(File file)
{
configuration.open(file);
}
product/Service/Service.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.Service</RootNamespace>
- <AssemblyName>MoMoney.Service</AssemblyName>
+ <RootNamespace>momoney.service</RootNamespace>
+ <AssemblyName>momoney.service</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@@ -88,87 +88,86 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Application\AddNewIncomeCommand.cs" />
- <Compile Include="Application\AddNewIncomeCommandSpecs.cs" />
- <Compile Include="Application\GetTheCurrentCustomerQuery.cs" />
- <Compile Include="Application\EventLog.cs" />
- <Compile Include="Application\GetAllBillsQuery.cs" />
- <Compile Include="Application\GetAllCompanysQuery.cs" />
- <Compile Include="Application\GetAllIncomeQuery.cs" />
- <Compile Include="Application\IEventLog.cs" />
- <Compile Include="Application\RegisterNewCompanyCommand.cs" />
- <Compile Include="Application\SaveNewBillCommand.cs" />
- <Compile Include="Infrastructure\debugging\Launch.cs" />
- <Compile Include="Infrastructure\Eventing\EventAggregator.cs" />
- <Compile Include="Infrastructure\Eventing\EventAggregatorSpecs.cs" />
- <Compile Include="Infrastructure\Eventing\IEvent.cs" />
- <Compile Include="Infrastructure\Eventing\IEventAggregator.cs" />
- <Compile Include="Infrastructure\Eventing\IEventSubscriber.cs" />
- <Compile Include="Infrastructure\Logging\LogFileTasks.cs" />
- <Compile Include="Infrastructure\ProjectTasks.cs" />
- <Compile Include="Infrastructure\Security\IsInRole.cs" />
- <Compile Include="Infrastructure\Security\IsInRoleSpecs.cs" />
- <Compile Include="Infrastructure\Security\Role.cs" />
- <Compile Include="Infrastructure\Threading\AsynchronousCommandProcessor.cs" />
- <Compile Include="Infrastructure\Threading\BackgroundThread.cs" />
- <Compile Include="Infrastructure\Threading\BackgroundThreadFactory.cs" />
- <Compile Include="Infrastructure\Threading\BackgroundThreadFactorySpecs.cs" />
- <Compile Include="Infrastructure\Threading\BackgroundThreadSpecs.cs" />
- <Compile Include="Infrastructure\Threading\CommandProcessor.cs" />
- <Compile Include="Infrastructure\Threading\CommandProcessorSpecs.cs" />
- <Compile Include="Infrastructure\Threading\ICommandProcessor.cs" />
- <Compile Include="Infrastructure\Threading\IntervalTimer.cs" />
- <Compile Include="Infrastructure\Threading\IntervalTimerSpecs.cs" />
- <Compile Include="Infrastructure\Threading\ITimerClient.cs" />
- <Compile Include="Infrastructure\Threading\IWorkerThread.cs" />
- <Compile Include="Infrastructure\Threading\RaiseEventInterceptor.cs" />
- <Compile Include="Infrastructure\Threading\RunOnBackgroundThreadInterceptor.cs" />
- <Compile Include="Infrastructure\Threading\RunOnBackgroundThreadInterceptorSpecs.cs" />
- <Compile Include="Infrastructure\Threading\RunOnUIThread.cs" />
- <Compile Include="Infrastructure\Threading\SynchronizationContextFactory.cs" />
- <Compile Include="Infrastructure\Threading\SynchronizedCommand.cs" />
- <Compile Include="Infrastructure\Threading\SynchronizedContext.cs" />
- <Compile Include="Infrastructure\Threading\Synchronizer.cs" />
- <Compile Include="Infrastructure\Threading\ThreadingExtensions.cs" />
- <Compile Include="Infrastructure\Threading\TimerFactory.cs" />
- <Compile Include="Infrastructure\Threading\TimerFactorySpecs.cs" />
- <Compile Include="Infrastructure\Threading\WorkerThread.cs">
+ <Compile Include="application\AddNewIncomeCommand.cs" />
+ <Compile Include="application\AddNewIncomeCommandSpecs.cs" />
+ <Compile Include="application\GetTheCurrentCustomerQuery.cs" />
+ <Compile Include="application\EventLog.cs" />
+ <Compile Include="application\GetAllBillsQuery.cs" />
+ <Compile Include="application\GetAllCompanysQuery.cs" />
+ <Compile Include="application\GetAllIncomeQuery.cs" />
+ <Compile Include="application\IEventLog.cs" />
+ <Compile Include="application\RegisterNewCompanyCommand.cs" />
+ <Compile Include="application\SaveNewBillCommand.cs" />
+ <Compile Include="infrastructure\eventing\EventAggregator.cs" />
+ <Compile Include="infrastructure\eventing\EventAggregatorSpecs.cs" />
+ <Compile Include="infrastructure\eventing\IEvent.cs" />
+ <Compile Include="infrastructure\eventing\IEventAggregator.cs" />
+ <Compile Include="infrastructure\eventing\IEventSubscriber.cs" />
+ <Compile Include="infrastructure\logging\LogFileTasks.cs" />
+ <Compile Include="infrastructure\ProjectTasks.cs" />
+ <Compile Include="infrastructure\security\IsInRole.cs" />
+ <Compile Include="infrastructure\security\IsInRoleSpecs.cs" />
+ <Compile Include="infrastructure\security\Role.cs" />
+ <Compile Include="infrastructure\threading\AsynchronousCommandProcessor.cs" />
+ <Compile Include="infrastructure\threading\BackgroundThread.cs" />
+ <Compile Include="infrastructure\threading\BackgroundThreadFactory.cs" />
+ <Compile Include="infrastructure\threading\BackgroundThreadFactorySpecs.cs" />
+ <Compile Include="infrastructure\threading\BackgroundThreadSpecs.cs" />
+ <Compile Include="infrastructure\threading\CommandProcessor.cs" />
+ <Compile Include="infrastructure\threading\CommandProcessorSpecs.cs" />
+ <Compile Include="infrastructure\threading\ICommandProcessor.cs" />
+ <Compile Include="infrastructure\threading\IntervalTimer.cs" />
+ <Compile Include="infrastructure\threading\IntervalTimerSpecs.cs" />
+ <Compile Include="infrastructure\threading\ITimerClient.cs" />
+ <Compile Include="infrastructure\threading\IWorkerThread.cs" />
+ <Compile Include="infrastructure\threading\RaiseEventInterceptor.cs" />
+ <Compile Include="infrastructure\threading\RunOnBackgroundThreadInterceptor.cs" />
+ <Compile Include="infrastructure\threading\RunOnBackgroundThreadInterceptorSpecs.cs" />
+ <Compile Include="infrastructure\threading\RunOnUIThread.cs" />
+ <Compile Include="infrastructure\threading\SynchronizationContextFactory.cs" />
+ <Compile Include="infrastructure\threading\SynchronizedCommand.cs" />
+ <Compile Include="infrastructure\threading\SynchronizedContext.cs" />
+ <Compile Include="infrastructure\threading\Synchronizer.cs" />
+ <Compile Include="infrastructure\threading\ThreadingExtensions.cs" />
+ <Compile Include="infrastructure\threading\TimerFactory.cs" />
+ <Compile Include="infrastructure\threading\TimerFactorySpecs.cs" />
+ <Compile Include="infrastructure\threading\WorkerThread.cs">
<SubType>Component</SubType>
</Compile>
- <Compile Include="Infrastructure\Threading\WorkItem.cs" />
- <Compile Include="Infrastructure\Transactions\EmptyUnitOfWork.cs" />
- <Compile Include="Infrastructure\Transactions\UnitOfWork.cs" />
- <Compile Include="Infrastructure\Transactions\UnitOfWorkFactory.cs" />
- <Compile Include="Infrastructure\Transactions\UnitOfWorkFactorySpecs.cs" />
- <Compile Include="Infrastructure\Transactions\UnitOfWorkSpecs.cs" />
- <Compile Include="Infrastructure\Updating\CancelUpdate.cs" />
- <Compile Include="Infrastructure\Updating\CancelUpdateSpecs.cs" />
- <Compile Include="Infrastructure\Updating\CurrentDeployment.cs" />
- <Compile Include="Infrastructure\Updating\DownloadTheLatestVersion.cs" />
- <Compile Include="Infrastructure\Updating\IDeployment.cs" />
- <Compile Include="Infrastructure\Updating\NullDeployment.cs" />
- <Compile Include="Infrastructure\Updating\WhatIsTheAvailableVersion.cs" />
+ <Compile Include="infrastructure\threading\WorkItem.cs" />
+ <Compile Include="infrastructure\transactions\EmptyUnitOfWork.cs" />
+ <Compile Include="infrastructure\transactions\UnitOfWork.cs" />
+ <Compile Include="infrastructure\transactions\UnitOfWorkFactory.cs" />
+ <Compile Include="infrastructure\transactions\UnitOfWorkFactorySpecs.cs" />
+ <Compile Include="infrastructure\transactions\UnitOfWorkSpecs.cs" />
+ <Compile Include="infrastructure\updating\CancelUpdate.cs" />
+ <Compile Include="infrastructure\updating\CancelUpdateSpecs.cs" />
+ <Compile Include="infrastructure\updating\CurrentDeployment.cs" />
+ <Compile Include="infrastructure\updating\DownloadTheLatestVersion.cs" />
+ <Compile Include="infrastructure\updating\IDeployment.cs" />
+ <Compile Include="infrastructure\updating\NullDeployment.cs" />
+ <Compile Include="infrastructure\updating\WhatIsTheAvailableVersion.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\DataAccess\DataAccess.csproj">
+ <ProjectReference Include="..\database\database.csproj">
<Project>{580E68A8-EDEE-4350-8BBE-A053645B0F83}</Project>
- <Name>DataAccess</Name>
+ <Name>database</Name>
</ProjectReference>
- <ProjectReference Include="..\Domain\Domain.csproj">
+ <ProjectReference Include="..\Domain\domain.csproj">
<Project>{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}</Project>
- <Name>Domain</Name>
+ <Name>domain</Name>
</ProjectReference>
- <ProjectReference Include="..\DTO\DTO.csproj">
+ <ProjectReference Include="..\DTO\dto.csproj">
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
- <Name>DTO</Name>
+ <Name>dto</Name>
</ProjectReference>
- <ProjectReference Include="..\Service.Contracts\Service.Contracts.csproj">
+ <ProjectReference Include="..\Service.Contracts\service.contracts.csproj">
<Project>{41D2B68B-031B-44FF-BAC5-7752D9E29F94}</Project>
- <Name>Service.Contracts</Name>
+ <Name>service.contracts</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Folder Include="Domain\" />
+ <Folder Include="domain\" />
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
product/Service.Contracts/Application/IAddNewIncomeCommand.cs
@@ -1,11 +1,9 @@
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface IAddNewIncomeCommand : IParameterizedCommand<IncomeSubmissionDTO>
- {
- }
+ public interface IAddNewIncomeCommand : ParameterizedCommand<IncomeSubmissionDTO> {}
}
\ No newline at end of file
product/Service.Contracts/Application/IGetAllBillsQuery.cs
@@ -1,12 +1,10 @@
using System.Collections.Generic;
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface IGetAllBillsQuery : IQuery<IEnumerable<BillInformationDTO>>
- {
- }
+ public interface IGetAllBillsQuery : Query<IEnumerable<BillInformationDTO>> {}
}
\ No newline at end of file
product/Service.Contracts/Application/IGetAllCompanysQuery.cs
@@ -1,12 +1,10 @@
using System.Collections.Generic;
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface IGetAllCompanysQuery : IQuery<IEnumerable<CompanyDTO>>
- {
- }
+ public interface IGetAllCompanysQuery : Query<IEnumerable<CompanyDTO>> {}
}
\ No newline at end of file
product/Service.Contracts/Application/IGetAllIncomeQuery.cs
@@ -1,12 +1,10 @@
using System.Collections.Generic;
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface IGetAllIncomeQuery : IQuery<IEnumerable<IncomeInformationDTO>>
- {
- }
+ public interface IGetAllIncomeQuery : Query<IEnumerable<IncomeInformationDTO>> {}
}
\ No newline at end of file
product/Service.Contracts/Application/IRegisterNewCompanyCommand.cs
@@ -1,11 +1,9 @@
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface IRegisterNewCompanyCommand : IParameterizedCommand<RegisterNewCompany>
- {
- }
+ public interface IRegisterNewCompanyCommand : ParameterizedCommand<RegisterNewCompany> {}
}
\ No newline at end of file
product/Service.Contracts/Application/ISaveNewBillCommand.cs
@@ -1,11 +1,9 @@
using System.ServiceModel;
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Application
{
[ServiceContract]
- public interface ISaveNewBillCommand : IParameterizedCommand<AddNewBillDTO>
- {
- }
+ public interface ISaveNewBillCommand : ParameterizedCommand<AddNewBillDTO> {}
}
\ No newline at end of file
product/Service.Contracts/Infrastructure/Transactions/IUnitOfWork.cs
@@ -1,6 +1,6 @@
using System;
-namespace MoMoney.Service.Contracts.Infrastructure.Transactions
+namespace momoney.service.contracts.infrastructure.transactions
{
public interface IUnitOfWork : IDisposable
{
product/Service.Contracts/Infrastructure/Transactions/IUnitOfWorkFactory.cs
@@ -1,8 +1,7 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
+using momoney.service.contracts.infrastructure.transactions;
namespace MoMoney.Service.Contracts.Infrastructure.Transactions
{
- public interface IUnitOfWorkFactory : IFactory<IUnitOfWork>
- {
- }
+ public interface IUnitOfWorkFactory : Factory<IUnitOfWork> {}
}
\ No newline at end of file
product/Service.Contracts/Infrastructure/Updating/ICancelUpdate.cs
@@ -1,8 +1,6 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
-namespace MoMoney.Service.Contracts.Infrastructure.Updating
+namespace momoney.service.contracts.infrastructure.updating
{
- public interface ICancelUpdate : ICommand
- {
- }
+ public interface ICancelUpdate : Command {}
}
\ No newline at end of file
product/Service.Contracts/Infrastructure/Updating/IDownloadTheLatestVersion.cs
@@ -1,9 +1,7 @@
+using gorilla.commons.utility;
using Gorilla.Commons.Utility;
-using Gorilla.Commons.Utility.Core;
-namespace MoMoney.Service.Contracts.Infrastructure.Updating
+namespace momoney.service.contracts.infrastructure.updating
{
- public interface IDownloadTheLatestVersion : ICallbackCommand<Percent>
- {
- }
+ public interface IDownloadTheLatestVersion : CallbackCommand<Percent> {}
}
\ No newline at end of file
product/Service.Contracts/Infrastructure/Updating/IWhatIsTheAvailableVersion.cs
@@ -1,9 +1,9 @@
-using Gorilla.Commons.Utility.Core;
+using gorilla.commons.utility;
using MoMoney.DTO;
namespace MoMoney.Service.Contracts.Infrastructure.Updating
{
- public interface IWhatIsTheAvailableVersion : IQuery<ApplicationVersion>
+ public interface IWhatIsTheAvailableVersion : Query<ApplicationVersion>
{
}
}
\ No newline at end of file
product/Service.Contracts/Infrastructure/IProjectTasks.cs
@@ -4,7 +4,7 @@ namespace MoMoney.Service.Contracts.Infrastructure
{
public interface IProjectTasks
{
- void open(IFile file);
+ void open(File file);
void copy_to(string path);
void close(string path);
}
product/Service.Contracts/Service.Contracts.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{41D2B68B-031B-44FF-BAC5-7752D9E29F94}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MoMoney.Service.Contracts</RootNamespace>
- <AssemblyName>MoMoney.Service.Contracts</AssemblyName>
+ <RootNamespace>momoney.service.contracts</RootNamespace>
+ <AssemblyName>momoney.service.contracts</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@@ -56,29 +56,29 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Application\IAddNewIncomeCommand.cs" />
- <Compile Include="Application\IGetAllBillsQuery.cs" />
- <Compile Include="Application\IGetAllCompanysQuery.cs" />
- <Compile Include="Application\IGetAllIncomeQuery.cs" />
- <Compile Include="Application\IRegisterNewCompanyCommand.cs" />
- <Compile Include="Application\ISaveNewBillCommand.cs" />
- <Compile Include="Infrastructure\IProjectTasks.cs" />
- <Compile Include="Infrastructure\Logging\ILogFileTasks.cs" />
- <Compile Include="Infrastructure\Transactions\IUnitOfWork.cs" />
- <Compile Include="Infrastructure\Transactions\IUnitOfWorkFactory.cs" />
- <Compile Include="Infrastructure\Updating\ICancelUpdate.cs" />
- <Compile Include="Infrastructure\Updating\IDownloadTheLatestVersion.cs" />
- <Compile Include="Infrastructure\Updating\IWhatIsTheAvailableVersion.cs" />
+ <Compile Include="application\IAddNewIncomeCommand.cs" />
+ <Compile Include="application\IGetAllBillsQuery.cs" />
+ <Compile Include="application\IGetAllCompanysQuery.cs" />
+ <Compile Include="application\IGetAllIncomeQuery.cs" />
+ <Compile Include="application\IRegisterNewCompanyCommand.cs" />
+ <Compile Include="application\ISaveNewBillCommand.cs" />
+ <Compile Include="infrastructure\IProjectTasks.cs" />
+ <Compile Include="infrastructure\logging\ILogFileTasks.cs" />
+ <Compile Include="infrastructure\transactions\IUnitOfWork.cs" />
+ <Compile Include="infrastructure\transactions\IUnitOfWorkFactory.cs" />
+ <Compile Include="infrastructure\updating\ICancelUpdate.cs" />
+ <Compile Include="infrastructure\updating\IDownloadTheLatestVersion.cs" />
+ <Compile Include="infrastructure\updating\IWhatIsTheAvailableVersion.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\DTO\DTO.csproj">
+ <ProjectReference Include="..\DTO\dto.csproj">
<Project>{ACF52FAB-435B-48C9-A383-C787CB2D8000}</Project>
- <Name>DTO</Name>
+ <Name>dto</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Folder Include="Domain\" />
+ <Folder Include="domain\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
solution.sln
@@ -1,23 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "build\Build.csproj", "{B8505B10-85C7-45F4-B039-D364DD556D7D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj", "{B8505B10-85C7-45F4-B039-D364DD556D7D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boot", "product\Boot\Boot.csproj", "{2DB82691-BF15-4538-8C5E-6BF8F4F875A9}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "boot", "product\boot\boot.csproj", "{2DB82691-BF15-4538-8C5E-6BF8F4F875A9}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "product\Domain\Domain.csproj", "{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "domain", "product\domain\domain.csproj", "{BE790BCC-4412-473F-9D0A-5AA48FE7A74F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service", "product\Service\Service.csproj", "{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "service", "product\service\service.csproj", "{7EA4C557-6EF2-4B1F-85C8-5B3F51BAD8DB}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess", "product\DataAccess\DataAccess.csproj", "{580E68A8-EDEE-4350-8BBE-A053645B0F83}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "database", "product\database\database.csproj", "{580E68A8-EDEE-4350-8BBE-A053645B0F83}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTO", "product\DTO\DTO.csproj", "{ACF52FAB-435B-48C9-A383-C787CB2D8000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dto", "product\dto\dto.csproj", "{ACF52FAB-435B-48C9-A383-C787CB2D8000}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Presentation", "product\Presentation\Presentation.csproj", "{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "presentation", "product\presentation\presentation.csproj", "{D7C83DB3-492D-4514-8C53-C57AD8E7ACE7}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service.Contracts", "product\Service.Contracts\Service.Contracts.csproj", "{41D2B68B-031B-44FF-BAC5-7752D9E29F94}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utility", "product\utility\utility.csproj", "{22DF610D-CBC8-4042-A470-ABF246C5DDD4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "service.contracts", "product\service.contracts\service.contracts.csproj", "{41D2B68B-031B-44FF-BAC5-7752D9E29F94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -57,10 +55,6 @@ Global
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41D2B68B-031B-44FF-BAC5-7752D9E29F94}.Release|Any CPU.Build.0 = Release|Any CPU
- {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {22DF610D-CBC8-4042-A470-ABF246C5DDD4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE