Exemple #1
0
        private async void PlayButton_OnClicked(object sender, RoutedEventArgs e)
        {
            if (this._isInPlayHandler)
            {
                return;
            }
            this._isInPlayHandler = true;
            GameInvitationHeaderUC.HideInvitation(this.DataProvider);
            Game        game        = this.DataProvider.Game;
            GameRequest gameRequest = this.DataProvider.GameRequest;
            bool        flag        = InstalledPackagesFinder.Instance.IsPackageInstalled(game.platform_id);

            EventAggregator.Current.Publish(new GamesActionEvent()
            {
                game_id      = game.id,
                visit_source = AppGlobalStateManager.Current.GlobalState.GamesVisitSource,
                action_type  = (GamesActionType)(flag ? 0 : 1),
                click_source = GamesClickSource.request,
                request_name = gameRequest.name
            });
            await Task.Delay(1000);

            Navigator.Current.OpenGame(game);
            this._isInPlayHandler = false;
        }
Exemple #2
0
        private static void OnIsSeparatorVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GameInvitationHeaderUC invitationHeaderUc = d as GameInvitationHeaderUC;

            if (invitationHeaderUc == null)
            {
                return;
            }
            // ISSUE: explicit reference operation
            bool newValue = (bool)e.NewValue;

            ((UIElement)invitationHeaderUc.BottomSeparator).Visibility = (newValue ? Visibility.Visible : Visibility.Collapsed);
        }
Exemple #3
0
        private static void OnDataProviderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GameInvitationHeaderUC invitationHeaderUc = d as GameInvitationHeaderUC;

            if (invitationHeaderUc == null)
            {
                return;
            }
            // ISSUE: explicit reference operation
            GameRequestHeader newValue = e.NewValue as GameRequestHeader;

            if (newValue == null)
            {
                return;
            }
            Game game = newValue.Game;
            User user = newValue.User;

            ((FrameworkElement)invitationHeaderUc.UserIconImage).Tag = user;
            ImageLoader.SetUriSource(invitationHeaderUc.UserIconImage, user.photo_max);
            ((FrameworkElement)invitationHeaderUc.GameIconImage).Tag = game;
            ImageLoader.SetUriSource(invitationHeaderUc.GameIconImage, game.icon_150);
            invitationHeaderUc.GameTitleTextBlock.Text = game.title;
            invitationHeaderUc.GameGenreTextBlock.Text = game.genre;
            List <Inline> inlineList = GameInvitationHeaderUC.ComposeInvitationText(user.Name);

            if (((IList)inlineList).IsNullOrEmpty())
            {
                return;
            }
            ((PresentationFrameworkCollection <Inline>)invitationHeaderUc.InvitationTextBlock.Inlines).Clear();
            using (List <Inline> .Enumerator enumerator = inlineList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Inline current = enumerator.Current;
                    ((PresentationFrameworkCollection <Inline>)invitationHeaderUc.InvitationTextBlock.Inlines).Add(current);
                }
            }
        }
Exemple #4
0
 private void HideButton_OnClicked(object sender, RoutedEventArgs e)
 {
     GameInvitationHeaderUC.HideInvitation(this.DataProvider);
 }