Пример #1
0
        /// <summary>
        /// 新建游戏
        /// </summary>
        private void NewGame()
        {
            NewGame newGame = new NewGame();

            newGame.CreateModule(null, m_ClientEvent);
            InitializeListView();
        }
Пример #2
0
        /// <summary>
        /// 编辑游戏
        /// </summary>
        private void EditGame()
        {
            int selectIndex = 0;

            try
            {
                //要更改游戏的所在行
                selectIndex = this.listViewGameList.SelectedItems[0].Index;
            }
            catch
            {
                MessageBox.Show(config.ReadConfigValue("MGM", "GL_UI_ChooseGame"), "", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            try
            {
                //要更改的游戏id
                int gameID = int.Parse(this.listViewGameList.Items[selectIndex].Tag.ToString());
                //传送到属性窗体的用户信息
                C_Global.CEnum.Message_Body[] messageBody = new C_Global.CEnum.Message_Body[3];

                for (int i = 0; i < mResult.GetLength(0); i++)
                {
                    if (int.Parse(mResult[i, 0].oContent.ToString()) == gameID)
                    {
                        messageBody[0].eTag     = C_Global.CEnum.TagFormat.TLV_INTEGER;
                        messageBody[0].eName    = C_Global.CEnum.TagName.GameID;
                        messageBody[0].oContent = gameID;

                        messageBody[1].eTag     = C_Global.CEnum.TagFormat.TLV_STRING;
                        messageBody[1].eName    = C_Global.CEnum.TagName.GameName;
                        messageBody[1].oContent = mResult[i, 1].oContent.ToString().Trim();

                        messageBody[2].eTag     = C_Global.CEnum.TagFormat.TLV_STRING;
                        messageBody[2].eName    = C_Global.CEnum.TagName.GameContent;
                        messageBody[2].oContent = mResult[i, 2].oContent.ToString().Trim();

                        NewGame newGame = null;
                        try
                        {
                            newGame = new NewGame(true, messageBody);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }

                        try
                        {
                            newGame.CreateModule(null, m_ClientEvent);
                            InitializeListView();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }