main
1using gorilla.commons.utility;
2using momoney.presentation.presenters;
3using momoney.service.infrastructure.threading;
4
5namespace MoMoney.Presentation.Presenters
6{
7 public interface ICommandFactory
8 {
9 Command create_for<T>(Callback<T> item, Query<T> query);
10 }
11
12 public class CommandFactory : ICommandFactory
13 {
14 readonly ISynchronizationContextFactory factory;
15
16 public CommandFactory(ISynchronizationContextFactory factory)
17 {
18 this.factory = factory;
19 }
20
21 public Command create_for<T>(Callback<T> item, Query<T> query)
22 {
23 return new RunQueryCommand<T>(item, new ProcessQueryCommand<T>(query, factory));
24 }
25 }
26}