コード例 #1
0
        public IEnumerable <IResult> OpenNewMatch()
        {
            MatchManager.CreateNewMatch();
            var next = ShowScreenResult.Of <NewMatchViewModel>();

            yield return(next);
        }
コード例 #2
0
ファイル: ShellViewModel.cs プロジェクト: freshprince88/TUMTT
        public IEnumerable <IResult> OpenNewMatch()
        {
            MatchManager.CreateNewMatch();
            this.NotifyOfPropertyChange(() => this.CanSaveMatch);
            this.NotifyOfPropertyChange(() => this.CanSaveMatchAs);
            this.NotifyOfPropertyChange(() => this.CanShowPlayer);
            this.NotifyOfPropertyChange(() => this.CanShowCompetition);
            Events.PublishOnUIThread(new HideMenuEvent());
            var next = ShowScreenResult.Of <NewMatchViewModel>();

            yield return(next);

            MatchManager.MatchSaveAs = false;
        }
コード例 #3
0
            public Task <MatchCreationResultDTO> Handle(Command request, CancellationToken cancellationToken)
            {
                var matchCreationResult = _matchManager.CreateNewMatch(request.Name, request.User);

                if (matchCreationResult.IsCreationSuccess == false)
                {
                    return(Task.FromResult(new MatchCreationResultDTO
                    {
                        IsCreationSuccess = false,
                        CreationFailReason = matchCreationResult.CreationFailReason,
                    }));
                }

                var matchDTO = MatchDTO.CreateFromMatch(matchCreationResult.Match);

                return(Task.FromResult(new MatchCreationResultDTO
                {
                    IsCreationSuccess = true,
                    Match = matchDTO,
                }));
            }