public void SetupPrimaryStatsViewModel()
        {
            var uiStateController = new UiStateController(_logger, new UiLockerContextFactory());

            _asyncCommandFactory        = new AsyncCommandFactory(_fakeNotifyTaskCompletionFactory, new AsyncCommandWatcherFactory(uiStateController), new TaskWrapper());
            _asyncCommandAdaptorFactory = new AsyncCommandAdaptorFactory(_asyncCommandFactory);

            _primaryStatsTableViewModel = new PrimaryStatsTableViewModel(_logger, _fakePrimaryStatsTableModel, _bindingHelper, _asyncCommandFactory,
                                                                         _asyncCommandAdaptorFactory, new UiThreadInvoker(_logger), new UiStateController(_logger, new UiLockerContextFactory()));
        }
        private void SetupUiUtilities()
        {
            _observableHelper  = new ObservableHelper();
            _uiThreadInvoker   = new UiThreadInvoker(_logger);
            _uiStateController = new UiStateController(_logger, new UiLockerContextFactory());
            var asyncCommandWatcherFactory = new AsyncCommandWatcherFactory(_uiStateController);

            _notifyTaskCompletionFactory = new NotifyTaskCompletionFactory(_logger);
            _asyncCommandFactory         = new AsyncCommandFactory(_notifyTaskCompletionFactory, asyncCommandWatcherFactory, new TaskWrapper());
            _asyncCommandAdaptorFactory  = new AsyncCommandAdaptorFactory(_asyncCommandFactory);
        }
Exemple #3
0
        public SkillTableViewModel(ILogger logger, ISkillTableModel model, IAsyncCommandFactory asyncCommandFactory, IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory,
                                   IUiThreadInvoker uiThreadInvoker, IUiStateController uiStateController, ISkillTableViewModelBindingHelper bindingHelper) : base(uiThreadInvoker)
        {
            _logger            = logger;
            _uiThreadInvoker   = uiThreadInvoker;
            _uiStateController = uiStateController;
            _bindingHelper     = bindingHelper;

            _model = model;
            _model.PropertyChanged += ModelOnPropertyChanged;

            SetupTaskRunners(asyncCommandFactory);

            SetupCommandBindings(asyncCommandAdaptorFactory);
        }
        public void Setup()
        {
            _logger          = A.Fake <ILogger>();
            _model           = A.Fake <IPrimaryStatModel>();
            _uiThreadInvoker = A.Fake <IUiThreadInvoker>();
            _fakeNotifyTaskCompletionFactory = A.Fake <INotifyTaskCompletionFactory>();

            _realNotifyTaskCompletion = new NotifyTaskCompletion <object>(_logger);
            A.CallTo(() => _fakeNotifyTaskCompletionFactory.Create <object>()).Returns(_realNotifyTaskCompletion);

            var uiStateController = new UiStateController(_logger, new UiLockerContextFactory());

            _asyncCommandFactory = new AsyncCommandFactory(_fakeNotifyTaskCompletionFactory, new AsyncCommandWatcherFactory(uiStateController), new TaskWrapper());
            var asyncCommandAdaptorFactory = new AsyncCommandAdaptorFactory(_asyncCommandFactory);

            _primaryStatViewModel = new PrimaryStatViewModel(_logger, _model, asyncCommandAdaptorFactory, _uiThreadInvoker);
        }
 private void SetupTaskRunners(IAsyncCommandFactory asyncCommandFactory)
 {
     _primaryStatRequestCommand = asyncCommandFactory.CreateResultCommand(_model.RequestPrimaryStats);
     _primaryStatRequestCommand.PropertyChanged += PrimaryStatRequestCommandOnPropertyChanged;
 }
        public PrimaryStatsTableViewModel(ILogger logger, IPrimaryStatsTableModel model, IPrimaryStatTableViewModelBindingHelper bindingHelper, IAsyncCommandFactory asyncCommandFactory,
                                          IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory, IUiThreadInvoker uiThreadInvoker, IUiStateController uiStateController) : base(uiThreadInvoker)
        {
            _logger                     = logger;
            _model                      = model;
            _bindingHelper              = bindingHelper;
            _uiThreadInvoker            = uiThreadInvoker;
            _uiStateController          = uiStateController;
            _model.PrimaryStatsUpdated += ModelOnPrimaryStatsUpdated;

            SetupTaskRunners(asyncCommandFactory);

            Delete = asyncCommandAdaptorFactory.CreateWithContext(() => { _logger.LogEntry(); });
        }
Exemple #7
0
 public DemoEngine(IQueryFactory queryFactory, IAsyncCommandFactory commandFactory) : base(queryFactory, commandFactory)
 {
 }
 public AsyncCommandAdaptorFactory(IAsyncCommandFactory asyncCommandFactory)
 {
     _asyncCommandFactory = asyncCommandFactory;
 }
Exemple #9
0
 private void SetupTaskRunners(IAsyncCommandFactory asyncTaskRunnerFactory)
 {
     _skillsRequestCommand = asyncTaskRunnerFactory.CreateResultCommand(_model.RequestSkills);
     _skillsRequestCommand.PropertyChanged += SkillsRequestCommandOnPropertyChanged;
 }
 protected MicroCqrsEngine(IQueryFactory queryFactory, IAsyncCommandFactory commandFactory)
 {
     _queryFactory   = queryFactory;
     _commandFactory = commandFactory;
 }