Ejemplo n.º 1
0
        private void ViewGameStorageInfo(string gameid)
        {
            if (userID == "")
            {
                MessageBox.Show("未登录!", "message", MessageBoxButton.OK);
            }
            else
            {
                if (AccessHelper.GetGameStorage(gameid) == "0")
                {
                    MessageBox.Show("暂无库存!", "message", MessageBoxButton.OK);
                }
                else
                {
                    StorageWindow storageWindow = new StorageWindow();
                    storageWindow.Show();
                    storageWindow.ZhName.Content = AccessHelper.GetGameZhName(gameid);
                    storageWindow.EnName.Content = AccessHelper.GetGameEnName(gameid);
                    storageWindow.Pic.Source     = AccessHelper.GetGameImage(gameid);

                    //storageWindow.gameId = gameid;
                    for (int i = 0; i < Convert.ToInt32(AccessHelper.GetGameStorage(gameid)); i++)
                    {
                        MenuCenter.CreateStorageInfo(storageWindow.list, i, gameid);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void viewReleaseBtn_Click(object sender, RoutedEventArgs e)
        {
            UserReleaseWindow userReleaseWindow = new UserReleaseWindow();

            //userReleaseWindow.list = new Grid();
            userReleaseWindow.Show();

            userReleaseWindow.nickName.Content = nickName.Content;

            int count = AccessHelper.GetGameStorageCountFromUserID(userID);

            for (int i = 0; i < count; i++)
            {
                MenuCenter.CreateUserReleaseInfo(userReleaseWindow.list, i, userID);
            }
        }
Ejemplo n.º 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            EventCenter.AddListener <string, string>(EventType.Login, UserLogin);
            EventCenter.AddListener(EventType.Logout, UserLogout);
            EventCenter.AddListener <string>(EventType.ViewDetail, ViewGameStorageInfo);
            EventCenter.AddListener <string>(EventType.ReleaseInfo, ReleaseGameStorageInfo);
            EventCenter.AddListener <string>(EventType.UpdateGameList, UpdateGameInfo);
            EventCenter.AddListener <string>(EventType.UpdateNickname, UpdateUserNickname);
            EventCenter.AddListener <string>(EventType.ViewMessage, ViewStorageMessage);
            EventCenter.AddListener <string>(EventType.EditRelease, EditUserRelease);

            userCenterBtn.Visibility  = Visibility.Hidden;
            viewReleaseBtn.Visibility = Visibility.Hidden;

            int gameCount = AccessHelper.GetGameCount();

            for (int i = 0; i < gameCount; i++)
            {
                MenuCenter.CreateGameInfo(list, i);
            }
        }