private async void CommunicationService_Packet0006Received(object sender, Packet0006ReceivedEventArgs e)
        {
            if (e.IsMoved)
            {
                if (e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    if (e.NewGroupName.Equals(CurrentLocation.Init.ToString()))
                    {
                        if (this.Frame.CanGoBack)
                        {
                            ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("WaitingRoomToInitTextBlockConnectedAnimation", TextBlock_UserName);
                            this.NavigationCacheMode = NavigationCacheMode.Disabled;
                            UnregisterEvent();
                            this.Frame.GoBack();
                        }
                    }
                    else if (e.NewGroupName.Contains(CurrentLocation.PlayingRoom.ToString()))
                    {
                        GridView_Rooms.IsEnabled = true;
                        String extra_location = e.NewGroupName.Replace(CurrentLocation.PlayingRoom.ToString(), String.Empty);
                        ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("WaitingRoomToPlayingRoomTextBlockConnectedAnimation", TextBlock_UserName);
                        this.NavigationCacheMode = NavigationCacheMode.Enabled;
                        UnregisterEvent();
                        this.Frame.Navigate(typeof(PlayingRoomPage), extra_location, new EntranceNavigationTransitionInfo());
                    }
                }
            }
            else
            {
                if (e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    ContentDialog dialog = new ContentDialog()
                    {
                        Title           = "입장 실패",
                        Content         = $"{e.Message}",
                        CloseButtonText = "닫기",
                        DefaultButton   = ContentDialogButton.Close
                    };
                    dialog.Loading += async(send, args) => await this.Blur(value : 5, duration : 1000, delay : 0).StartAsync();

                    dialog.Closing += async(send, args) => await this.Blur(value : 0, duration : 500, delay : 0).StartAsync();

                    await dialog.ShowAsync();
                }
            }
        }
Beispiel #2
0
        private void CommunicationService_Packet0006Received(object sender, Packet0006ReceivedEventArgs e)
        {
            if (e.IsMoved)
            {
                if (e.Request.UserID.Equals(UserID))
                {
                    if (e.NewGroupName.Equals(CurrentLocation.WaitingRoom.ToString()))
                    {
                        Singleton <CommunicationService> .Instance.RequestSendMessage(UserID, UserName, $"{UserName}님이 접속하였습니다", true);

                        LogoutEnable = false;
                    }
                }
            }
            else
            {
                LogoutEnable = true;
            }
        }
Beispiel #3
0
        private async void CommunicationService_Packet0006Received(object sender, Packet0006ReceivedEventArgs e)
        {
            if (e.IsMoved)
            {
                if (e.SendFrom.Equals(ViewModel.UserName))
                {
                    if (e.NewGroupName.Equals(CurrentLocation.WaitingRoom.ToString()))
                    {
                        UnregisterEvent();
                        this.Frame.Navigate(typeof(WaitingRoomPage), new UserInfo()
                        {
                            UserId = ViewModel.UserID, UserPassword = ViewModel.UserPassword, UserName = ViewModel.UserName
                        }, new EntranceNavigationTransitionInfo());
                    }
                }
            }
            else
            {
                if (e.SendFrom.Equals(ViewModel.UserName))
                {
                    if (e.Request.NewGroupName.Equals(CurrentLocation.Init.ToString()) & e.Request.ExpectedOldGroupName.Equals(CurrentLocation.None.ToString()))
                    {
                    }
                    else
                    {
                        OnLogoutFailedStoryboard.Begin();
                        ContentDialog dialog = new ContentDialog()
                        {
                            Title           = "입장 실패",
                            Content         = $"{e.Message}",
                            CloseButtonText = "닫기",
                            DefaultButton   = ContentDialogButton.Close
                        };
                        dialog.Loading += async(send, args) => await this.Blur(value : 5, duration : 1000, delay : 0).StartAsync();

                        dialog.Closing += async(send, args) => await this.Blur(value : 0, duration : 500, delay : 0).StartAsync();

                        await dialog.ShowAsync();
                    }
                }
            }
        }
        private void CommunicationService_Packet0006Received(object sender, Packet0006ReceivedEventArgs e)
        {
            if (e.IsMoved)
            {
                if (e.NewGroupName.Equals(CurrentLocation.Init.ToString()) & e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    Singleton <CommunicationService> .Instance.Packet0005Received -= CommunicationService_Packet0005Received;
                    Singleton <CommunicationService> .Instance.Packet0006Received -= CommunicationService_Packet0006Received;
                    Singleton <CommunicationService> .Instance.Packet0007Received -= CommunicationService_Packet0007Received;
                }

                if (!e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    UserInfo        target_user    = UserList.FirstOrDefault <UserInfo>(x => x.UserName.Equals(e.SendFrom));
                    CurrentLocation location       = (CurrentLocation)Enum.Parse(typeof(CurrentLocation), e.NewGroupName);
                    String          extra_location = String.Empty;
                    if (e.NewGroupName.Contains(CurrentLocation.PlayingRoom.ToString()))
                    {
                        location       = CurrentLocation.PlayingRoom;
                        extra_location = e.NewGroupName.Replace(CurrentLocation.PlayingRoom.ToString(), String.Empty);
                    }
                    if (target_user == null)
                    {
                        UserList.Add(new UserInfo()
                        {
                            UserName = e.SendFrom, Location = location, ExtraLocation = extra_location
                        });
                    }
                    else
                    {
                        UserList.Remove(target_user);
                        UserList.Add(new UserInfo()
                        {
                            UserName = e.SendFrom, Location = location, ExtraLocation = extra_location
                        });
                    }
                }
            }
        }
        private async void CommunicationService_Packet0006Received(object sender, Packet0006ReceivedEventArgs e)
        {
            if (e.IsMoved)
            {
                if (e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    if (e.NewGroupName.Equals(CurrentLocation.WaitingRoom.ToString()))
                    {
                        if (this.Frame.CanGoBack)
                        {
                            //Singleton<CommunicationService>.Instance.Packet0006Received -= CommunicationService_Packet0006Received;
                            ConnectedAnimationService service = ConnectedAnimationService.GetForCurrentView();
                            service.PrepareToAnimate("PlayingRoomToWaitingRoomTextBlockConnectedAnimation", TextBlock_UserName);
                            UnregisterEvent();
                            this.Frame.GoBack();
                        }
                    }
                }
            }
            else
            {
                if (e.SendFrom.Equals(Singleton <GGTService> .Instance.UserName))
                {
                    ContentDialog dialog = new ContentDialog()
                    {
                        Title           = "입장 실패",
                        Content         = $"{e.Message}",
                        CloseButtonText = "닫기",
                        DefaultButton   = ContentDialogButton.Close
                    };
                    dialog.Loading += async(send, args) => await this.Blur(value : 5, duration : 1000, delay : 0).StartAsync();

                    dialog.Closing += async(send, args) => await this.Blur(value : 0, duration : 500, delay : 0).StartAsync();

                    await dialog.ShowAsync();
                }
            }
        }