public GamingSummaryViewModel(GameController controller, IGameControlService controlService, IRegistrationService registrationService, IContestDao contestDao, IEventAggregator eventAggregator)
		{
			_controller = controller;
			_controlService = controlService;
			_registrationService = registrationService;
			_contestDao = contestDao;

			this.OpenGameSelectionCommand = _controller.OpenGameSelectionCommand;
			this.StartGameCommand = DelegateCommand<SequencingItem>.FromAsyncHandler(StartGame);
			this.MakeShotCommand = DelegateCommand<string>.FromAsyncHandler(MakeShot);
			this.EditShotCommand = new DelegateCommand<string>(EditShot);
			this.NewGameCommand = DelegateCommand.FromAsyncHandler(NewGame, CanNewGame);

			eventAggregator.GetEvent<GameSelected>().Subscribe((payload) => this.CurrentGame = payload);

			_liveBus = ServiceBusFactory.New(sbc =>
			{
				sbc.UseMsmq(msmq =>
				{
					msmq.UseMulticastSubscriptionClient();
					msmq.VerifyMsmqConfiguration();
				});
				sbc.ReceiveFrom("msmq://localhost/ramp-festival_live_sender");
				sbc.SetNetwork("WORKGROUP");
			});
		}
예제 #2
0
		public HomeViewModel(RegistrationsController registrationsController, GameController gameController, LiveController liveController)
		{
			_registrationsController = registrationsController;

			this.GoToRegistrationCommand = new DelegateCommand(GoToRegistration);
            this.OpenGameSelectionCommand = gameController.OpenGameSelectionCommand;
            this.LiveShowCommand = liveController.LiveShowCommand;
		}
        public GameSelectionViewModel(GameController controller, IContestDao contestDao, Guid contestId)
        {
            _contestDao = contestDao;

            this.SelectGameCommand = controller.SelectGameCommand;

            this.PendingGames = new NotifyTaskCompletion<IList<SequencingItem>>(
                _contestDao.GetAllPendingGames());
        }