Commit d7ad224
Changed files (17)
trunk
build
product
MyMoney
boot
container
registration
Infrastructure
Container
Windsor
configuration
Threading
transactions2
Presentation
Core
Model
Projects
Presenters
Navigation
Views
Navigation
Tasks
infrastructure
trunk/build/build.bat
@@ -1,4 +1,4 @@
@echo off
cls
-tools\nant\nant.exe -buildfile:project.build %*
+tools\nant\nant.exe -nologo -buildfile:project.build %*
@echo %time%
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/proxy_configuration/SynchronizedConfiguration.cs
@@ -8,7 +8,7 @@ namespace MoMoney.boot.container.registration.proxy_configuration
{
public void configure(IProxyBuilder<T> item)
{
- item.add_interceptor<ThreadSafeInterceptor>().intercept_all();
+ item.add_interceptor<RunOnUIThread>().intercept_all();
}
}
}
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/SynchronizedConfiguration.cs
@@ -8,7 +8,7 @@ namespace MoMoney.boot.container.registration
{
public void configure(IProxyBuilder<T> item)
{
- item.add_interceptor<ThreadSafeInterceptor>().intercept_all();
+ item.add_interceptor<RunOnUIThread>().intercept_all();
}
}
}
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_presentation_modules.cs
@@ -1,5 +1,6 @@
using System.Reflection;
using MoMoney.Infrastructure.Container;
+using MoMoney.Infrastructure.interceptors;
using MoMoney.Infrastructure.reflection;
using MoMoney.Modules.Core;
using MoMoney.Presentation.Core;
@@ -30,8 +31,7 @@ namespace MoMoney.boot.container.registration
public void run(IAssembly item)
{
registry.proxy<IApplicationController, SynchronizedConfiguration<IApplicationController>>(
- () =>
- new ApplicationController(resolve.dependency_for<IPresenterRegistry>(), resolve.dependency_for<IShell>()));
+ () => new ApplicationController(Lazy.load<IPresenterRegistry>(), Lazy.load<IShell>()));
registry.transient(typeof (IRunThe<>), typeof (RunThe<>));
registry.transient<IFileMenu, FileMenu>();
registry.transient<IWindowMenu, WindowMenu>();
@@ -41,12 +41,14 @@ namespace MoMoney.boot.container.registration
.all_types()
.where(x => typeof (IPresenter).IsAssignableFrom(x))
.where(x => !x.IsInterface)
+ .where(x => !x.IsAbstract)
.each(type => registry.transient(typeof (IPresenter), type));
item
.all_types()
.where(x => typeof (IModule).IsAssignableFrom(x))
.where(x => !x.IsInterface)
+ .where(x => !x.IsAbstract)
.each(type => registry.transient(typeof (IModule), type));
}
}
trunk/product/MyMoney/Infrastructure/Container/Windsor/configuration/ComponentExclusionSpecification.cs
@@ -12,6 +12,7 @@ namespace MoMoney.Infrastructure.Container.Windsor.configuration
.or(type.is_an_implementation_of_dependency_registry())
.or(type.is_an_entity())
.or(type.is_an_interface())
+ .or(type.is_abstract())
.is_satisfied_by(type);
}
}
trunk/product/MyMoney/Infrastructure/Container/Windsor/configuration/type_extensions.cs
@@ -5,31 +5,36 @@ using MoMoney.Utility.Core;
namespace MoMoney.Infrastructure.Container.Windsor.configuration
{
- static public class type_extensions
+ public static class type_extensions
{
- static public ISpecification<Type> has_no_interfaces(this Type item)
+ public static ISpecification<Type> has_no_interfaces(this Type item)
{
return new PredicateSpecification<Type>(x => x.GetInterfaces().Length == 0);
}
- static public ISpecification<Type> subclasses_form(this Type item)
+ public static ISpecification<Type> subclasses_form(this Type item)
{
return new PredicateSpecification<Type>(x => typeof (Form).IsAssignableFrom(x));
}
- static public ISpecification<Type> is_an_implementation_of_dependency_registry(this Type item)
+ public static ISpecification<Type> is_an_implementation_of_dependency_registry(this Type item)
{
return new PredicateSpecification<Type>(x => typeof (IDependencyRegistry).IsAssignableFrom(x));
}
- static public ISpecification<Type> is_an_entity(this Type item)
+ public static ISpecification<Type> is_an_entity(this Type item)
{
return new PredicateSpecification<Type>(x => typeof (IEntity).IsAssignableFrom(x));
}
- static public ISpecification<Type> is_an_interface(this Type item)
+ public static ISpecification<Type> is_an_interface(this Type item)
{
return new PredicateSpecification<Type>(x => x.IsInterface);
}
+
+ public static ISpecification<Type> is_abstract(this Type item)
+ {
+ return new PredicateSpecification<Type>(x => x.IsAbstract);
+ }
}
}
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/Threading/ThreadSafeInterceptor.cs → trunk/product/MyMoney/Infrastructure/Threading/RunOnUIThread.cs
@@ -4,19 +4,15 @@ using MoMoney.Utility.Core;
namespace MoMoney.Infrastructure.Threading
{
- public interface IThreadSafeInterceptor : IInterceptor
- {
- }
-
- public class ThreadSafeInterceptor : IThreadSafeInterceptor
+ public class RunOnUIThread : IInterceptor
{
readonly ISynchronizationContextFactory factory;
- public ThreadSafeInterceptor() : this(Lazy.load<ISynchronizationContextFactory>())
+ public RunOnUIThread() : this(Lazy.load<ISynchronizationContextFactory>())
{
}
- public ThreadSafeInterceptor(ISynchronizationContextFactory factory)
+ public RunOnUIThread(ISynchronizationContextFactory factory)
{
this.factory = factory;
}
trunk/product/MyMoney/Infrastructure/transactions2/Database.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -45,6 +46,13 @@ namespace MoMoney.Infrastructure.transactions2
path.copy_to(new_path);
}
+ public void close(string name)
+ {
+ path.delete();
+ path = new ApplicationFile(Path.GetTempFileName());
+
+ }
+
IFile path_to_database()
{
return path;
trunk/product/MyMoney/Infrastructure/transactions2/IDatabaseConfiguration.cs
@@ -6,5 +6,6 @@ namespace MoMoney.Infrastructure.transactions2
{
void open(IFile file);
void copy_to(string path);
+ void close(string name);
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Core/ContentPresenter.cs
@@ -0,0 +1,15 @@
+using MoMoney.Presentation.Views.core;
+
+namespace MoMoney.Presentation.Core
+{
+ public abstract class ContentPresenter<T> : IContentPresenter where T : IDockedContentView
+ {
+ protected ContentPresenter(T view)
+ {
+ View = view;
+ }
+
+ public abstract void run();
+ public IDockedContentView View { get; set; }
+ }
+}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Model/Projects/file.cs
@@ -8,6 +8,7 @@ namespace MoMoney.Presentation.Model.Projects
string path { get; }
bool does_the_file_exist();
void copy_to(string path);
+ void delete();
}
internal class ApplicationFile : IFile
@@ -30,6 +31,11 @@ namespace MoMoney.Presentation.Model.Projects
File.Copy(path, other_path, true);
}
+ public void delete()
+ {
+ File.Delete(path);
+ }
+
public static implicit operator ApplicationFile(string file_path)
{
return new ApplicationFile(file_path);
trunk/product/MyMoney/Presentation/Model/Projects/ProjectController.cs
@@ -59,6 +59,7 @@ namespace MoMoney.Presentation.Model.Projects
public void close_project()
{
if (!project.is_open()) return;
+ configuration.close(project.name());
project = new EmptyProject();
broker.publish<ClosingProjectEvent>();
}
trunk/product/MyMoney/Tasks/infrastructure/LogFileTasks.cs
@@ -27,7 +27,7 @@ namespace MoMoney.Tasks.infrastructure
public string get_the_path_to_the_log_file()
{
- return Path.Combine(this.startup_directory(), "logs/log.txt");
+ return Path.Combine(this.startup_directory(), @"logs\log.txt");
}
//public void notify(ICallback<string> view)
trunk/product/MyMoney/MyMoney.csproj
@@ -107,10 +107,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\build\tools\mbunit\MbUnit.Framework.dll</HintPath>
</Reference>
- <Reference Include="ObjectListView, Version=2.1.0.26964, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\lib\app\object.list.view\ObjectListView.dll</HintPath>
- </Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
@@ -309,7 +305,7 @@
<Compile Include="Infrastructure\Threading\SynchronizationContextFactory.cs" />
<Compile Include="Infrastructure\Threading\SynchronizedCommand.cs" />
<Compile Include="Infrastructure\Threading\SynchronizedContext.cs" />
- <Compile Include="Infrastructure\Threading\ThreadSafeInterceptor.cs" />
+ <Compile Include="Infrastructure\Threading\RunOnUIThread.cs" />
<Compile Include="Infrastructure\Threading\TimerFactory.cs" />
<Compile Include="Infrastructure\Threading\WorkerThread.cs">
<SubType>Component</SubType>
@@ -346,6 +342,7 @@
<Compile Include="Infrastructure\transactions\unit_of_work_specs.cs" />
<Compile Include="Modules\ApplicationShellModule.cs" />
<Compile Include="Modules\DatabaseModule.cs" />
+ <Compile Include="Presentation\Core\ContentPresenter.cs" />
<Compile Include="Presentation\Core\IContentPresenter.cs" />
<Compile Include="Presentation\Databindings\date_time_picker_property_binding.cs" />
<Compile Include="Presentation\Databindings\date_time_property_binding_specs.cs" />