Commit 4116ee0
Changed files (14)
trunk
product
Gorilla.Commons.Infrastructure
Container
Logging
Gorilla.Commons.Infrastructure.ThirdParty
Gorilla.Commons.Utility
Gorilla.Commons.Windows.Forms
Helpers
MoMoney.Presentation
Model
Menu
MyMoney
boot
trunk/product/Gorilla.Commons.Infrastructure/Container/Resolve.cs
@@ -13,7 +13,7 @@ namespace Gorilla.Commons.Infrastructure.Container
initialized = registry != null;
}
- static public DependencyToResolve a<DependencyToResolve>()
+ static public DependencyToResolve the<DependencyToResolve>()
{
try
{
trunk/product/Gorilla.Commons.Infrastructure/Container/ResolveSpecs.cs
@@ -20,7 +20,7 @@ namespace Gorilla.Commons.Infrastructure.Container
Resolve.initialize_with(registry);
};
- because b = () => { result = Resolve.a<ICommand>(); };
+ because b = () => { result = Resolve.the<ICommand>(); };
it should_leverage_the_underlying_container_it_was_initialized_with =
() => registry.was_told_to(x => x.get_a<ICommand>());
@@ -43,7 +43,7 @@ namespace Gorilla.Commons.Infrastructure.Container
Resolve.initialize_with(registry);
};
- because b = () => { the_call = call.to(() => Resolve.a<ICommand>()); };
+ because b = () => { the_call = call.to(() => Resolve.the<ICommand>()); };
after_each_observation a = () => Resolve.initialize_with(null);
trunk/product/Gorilla.Commons.Infrastructure/Logging/Log.cs
@@ -15,7 +15,7 @@ namespace Gorilla.Commons.Infrastructure.Logging
{
try
{
- return Resolve.a<ILogFactory>().create_for(type_to_create_a_logger_for);
+ return Resolve.the<ILogFactory>().create_for(type_to_create_a_logger_for);
}
catch
{
trunk/product/Gorilla.Commons.Infrastructure.ThirdParty/Lazy.cs
@@ -16,7 +16,7 @@ namespace Gorilla.Commons.Infrastructure
static IInterceptor create_interceptor_for<T>() where T : class
{
- Func<T> get_the_implementation = Resolve.a<T>;
+ Func<T> get_the_implementation = Resolve.the<T>;
return new LazyLoadedInterceptor<T>(get_the_implementation.memorize());
}
trunk/product/Gorilla.Commons.Utility/Core/IImport.cs
@@ -0,0 +1,7 @@
+namespace Gorilla.Commons.Utility.Core
+{
+ public interface IImport<T>
+ {
+ void import(T item);
+ }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Utility/Core/IParser.cs
@@ -0,0 +1,7 @@
+namespace Gorilla.Commons.Utility.Core
+{
+ public interface IParser<T>
+ {
+ T parse();
+ }
+}
\ No newline at end of file
trunk/product/Gorilla.Commons.Utility/Core/IQuery.cs
@@ -1,7 +1,12 @@
namespace Gorilla.Commons.Utility.Core
{
- public interface IQuery<T>
+ public interface IQuery<TOutput>
{
- T fetch();
+ TOutput fetch();
+ }
+
+ public interface IQuery<TInput, TOutput>
+ {
+ TOutput fetch(TInput item);
}
}
\ No newline at end of file
trunk/product/Gorilla.Commons.Utility/Gorilla.Commons.Utility.csproj
@@ -74,8 +74,10 @@
<Compile Include="Core\IDisposableCommand.cs" />
<Compile Include="Core\IFactory.cs" />
<Compile Include="Core\IIdentifiable.cs" />
+ <Compile Include="Core\IImport.cs" />
<Compile Include="Core\IMapper.cs" />
<Compile Include="Core\IParameterizedCommand.cs" />
+ <Compile Include="Core\IParser.cs" />
<Compile Include="Core\IQuery.cs" />
<Compile Include="Core\IRegistry.cs" />
<Compile Include="Core\ISpecification.cs" />
trunk/product/Gorilla.Commons.Windows.Forms/Helpers/ButtonExtensions.cs
@@ -24,7 +24,7 @@ namespace Gorilla.Commons.Windows.Forms.Helpers
static public Button will_execute<Command>(this Button button, Func<bool> when) where Command : ICommand
{
- button.Click += (sender, e) => { if (when()) Resolve.a<Command>().run(); };
+ button.Click += (sender, e) => { if (when()) Resolve.the<Command>().run(); };
button.Enabled = when();
return button;
}
trunk/product/MoMoney.Presentation/Model/Menu/create.cs
@@ -6,7 +6,7 @@ namespace MoMoney.Presentation.Model.Menu
{
public static IMenuItemBuilder a_menu_item()
{
- return Resolve.a<IMenuItemBuilder>();
+ return Resolve.the<IMenuItemBuilder>();
}
public static IMenuItem a_menu_item_separator()
@@ -16,7 +16,7 @@ namespace MoMoney.Presentation.Model.Menu
public static IToolbarItemBuilder a_tool_bar_item()
{
- return Resolve.a<IToolbarItemBuilder>();
+ return Resolve.the<IToolbarItemBuilder>();
}
}
}
\ No newline at end of file
trunk/product/MyMoney/boot/container/registration/wire_up_the_data_access_components_into_the.cs
@@ -20,8 +20,8 @@ namespace MoMoney.boot.container.registration
public void run()
{
register.singleton<IDatabase, ObjectDatabase>();
- register.singleton(() => Resolve.a<IDatabase>().downcast_to<IDatabaseConfiguration>());
- register.proxy<ISession, NoConfiguration<ISession>>( () => Resolve.a<ISessionProvider>().get_the_current_session());
+ register.singleton(() => Resolve.the<IDatabase>().downcast_to<IDatabaseConfiguration>());
+ register.proxy<ISession, NoConfiguration<ISession>>( () => Resolve.the<ISessionProvider>().get_the_current_session());
}
}
}
\ No newline at end of file
trunk/product/MyMoney/boot/global_error_handling.cs
@@ -20,7 +20,7 @@ namespace MoMoney.boot
void handle(Exception e)
{
e.add_to_log();
- Resolve.a<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
+ Resolve.the<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
}
}
}
\ No newline at end of file
trunk/product/MyMoney/boot/start_the_application.cs
@@ -12,11 +12,12 @@ namespace MoMoney.boot
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)
+ public start_the_application(IBackgroundThread thread, ILoadPresentationModulesCommand command,
+ ICommandProcessor processor)
{
this.thread = thread;
this.command = command;
trunk/product/MyMoney/boot/WindowsFormsApplication.cs
@@ -22,7 +22,7 @@ namespace MoMoney.boot
{
public class WindowsFormsApplication<Shell> : ICommand where Shell : Form
{
- public WindowsFormsApplication()
+ protected WindowsFormsApplication()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles();
@@ -55,12 +55,12 @@ namespace MoMoney.boot
{
try
{
- Application.Run(Resolve.a<Shell>());
+ Application.Run(Resolve.the<Shell>());
}
catch (Exception e)
{
this.log().error(e);
- Resolve.a<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
+ Resolve.the<IEventAggregator>().publish(new UnhandledErrorOccurred(e));
}
}
}