Exemplo n.º 1
0
        // 2014-01-21: GreenRose
        private void SetDownloadState(GameInfo gameInfo)
        {
            string      strIniFilePath = System.Windows.Forms.Application.StartupPath + "\\userinfo.ini";
            IniFileEdit iniFileEdit    = new IniFileEdit(strIniFilePath);

            iniFileEdit.SetIniValue("GameInfo", gameInfo.Source, "1");
        }
Exemplo n.º 2
0
        public void SetStyleInitValue(string strTagName, string strTagValue)
        {
            string strUserInfoPath = System.Windows.Forms.Application.StartupPath + "\\UserInfo.ini";

            if (System.IO.File.Exists(strUserInfoPath))
            {
                IniFileEdit iniFileEdit = new IniFileEdit(strUserInfoPath);
                iniFileEdit.SetIniValue("StyleInfo", strTagName, strTagValue);
            }
        }
Exemplo n.º 3
0
        private void InitSetting()
        {
            IniFileEdit _FileEdit = new IniFileEdit(_UserPath);

            _ServerRealUri    = _FileEdit.GetIniValue("ServerInfo", "ServerRealUri");
            _ServerUri        = _FileEdit.GetIniValue("ServerInfo", "ServerUri");
            _ServerPort       = _FileEdit.GetIniValue("ServerInfo", "ServerPort");
            _ServerServiceUri = _FileEdit.GetIniValue("ServerInfo", "ServerServiceUri");
            _ServerPath       = "http://" + _ServerRealUri + "/";
        }
Exemplo n.º 4
0
        private void InitSetting()
        {
            IniFileEdit _FileEdit = new IniFileEdit(_UserPath);

            _ServerRealUri    = _FileEdit.GetIniValue("ServerInfo", "ServerRealUri");              // 이미지,동영상 컨텐츠서버
            _ServerUri        = _FileEdit.GetIniValue("ServerInfo", "ServerUri");                  // 채팅 서버
            _ServerPort       = _FileEdit.GetIniValue("ServerInfo", "ServerPort");                 // 채팅 서버 포트
            _ServerServiceUri = _FileEdit.GetIniValue("ServerInfo", "ServerServiceUri");
            _ServerGamePath   = "http://" + _FileEdit.GetIniValue("ServerInfo", "ServerGamePath"); // 다운로드 서버
            _ServerPath       = "http://" + _ServerRealUri + "/";

            _strMainResourceDicSource = _FileEdit.GetIniValue("StyleInfo", "MainResource");
        }
Exemplo n.º 5
0
        static public void ShowError(ErrorType errorType)
        {
            IniFileEdit iniFileEdit = new IniFileEdit(_UserPath);
            string      errorString = iniFileEdit.GetIniValue("MessageString", errorType.ToString());

            if (errorString == "")
            {
                return;
            }
            else
            {
                MessageBoxCommon.Show(errorString, MessageBoxType.Ok);
            }
        }
Exemplo n.º 6
0
        static public void ShowError(ErrorType errorType)
        {
            IniFileEdit iniFileEdit = new IniFileEdit(_UserPath);
            string      errorString = iniFileEdit.GetIniValue("MessageString", errorType.ToString());

            if (errorString == "")
            {
                return;
            }
            else
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, errorString, "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);

                if (errorType == ErrorType.Unknown_User)
                {
                    Main tempMain = Main._main;
                    if (tempMain != null)
                    {
                        tempMain.ExitProgram();
                    }
                }
            }
        }
Exemplo n.º 7
0
        // 2014-01-21: GreenRose
        private bool CheckDownloadState(GameInfo gameInfo)
        {
            if (gameInfo.Downloadfolder.Trim().Length == 0)
            {
                return(true);
            }

            string      strIniFilePath = System.Windows.Forms.Application.StartupPath + "\\userinfo.ini";
            IniFileEdit iniFileEdit    = new IniFileEdit(strIniFilePath);

            string strVal = iniFileEdit.GetIniValue("GameInfo", gameInfo.Source);

            if (strVal == string.Empty)
            {
                return(false);
            }

            else if (strVal == "0")
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 8
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Reply_UpdateUser:
            {
                UserInfo userName = (UserInfo)baseInfo;
                Login.main.nickName.Content = userName.Nickname;

                ToolTip tt = new ToolTip();
                tt.Content = userName.Nickname;
                Login.main.nickName.ToolTip = tt;

                IniFileEdit _IniFileEdit = new IniFileEdit(Login._UserPath);

                ImageBrush updateImg = new ImageBrush();
                updateImg.Stretch = Stretch.Fill;
                _IniFileEdit.SetIniValue("UserInfo", "userImage", userName.Icon);

                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                bi.UriSource = new Uri(userName.Icon, UriKind.RelativeOrAbsolute);
                bi.EndInit();

                //updateImg.ImageSource = bi;
                updateImg.ImageSource     = ImageDownloader.GetInstance().GetImage(userName.Icon);
                myPicture.Fill            = updateImg;
                Login.main.memberImg.Fill = updateImg;

                ToolTip sign = new ToolTip();
                sign.Content = Login._UserInfo.Sign;
                Login.main.singBox.ToolTip = sign;
                //Login.main.singBox.Text = Login._UserInfo.Sign;

                if (selectGrid.Children.Count > 0 && selectGrid.Children[0] is MyInfoControl)
                {
                    MyInfoControl myInfoControl = (MyInfoControl)selectGrid.Children[0];

                    myInfoControl.buttonSave.IsEnabled = false;
                }

                //MessageBoxCommon.Show("更新成功", MessageBoxType.Ok);
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            }
            break;

            case NotifyType.Request_VideoUpload:
            {
                // 2014-02-09: GreenRose
                if (Main.loadWnd != null)
                {
                    Main.loadWnd.Close();
                    Main.loadWnd = null;
                }

                //List<IconInfo> listVideoInfo = new List<IconInfo>();
                IconInfo newIcon = (IconInfo)baseInfo;
                //iconInfoList.Add(newIcon);
                if (iconInfoList != null)
                {
                    iconInfoList.Add(newIcon);
                }
                else
                {
                    iconInfoList = new List <IconInfo>();
                    iconInfoList.Add(newIcon);
                }

                selectGrid.Children.Clear();
                PictureControl pictureControl = new PictureControl();
                pictureControl.InitVideoList(iconInfoList);
                selectGrid.Children.Add(pictureControl);

                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            }
            break;

            //case NotifyType.Reply_NewID:
            //     {
            //         UserInfo newUserInfo = (UserInfo)baseInfo;
            //         TempWindowForm tempWindowForm = new TempWindowForm();
            //         QQMessageBox.Show(tempWindowForm, "帐号申请通过." + newUserInfo.Id + "(首次登陆没有密码 登陆后请完善资料)", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            //         userInfoList.Add(newUserInfo);

            //         selectGrid.Children.Clear();
            //         NoticeMemberControl noticeMemberControl = new NoticeMemberControl();
            //         noticeMemberControl.listMember(userInfoList);
            //         selectGrid.Children.Add(noticeMemberControl);
            //     }
            //     break;
            case NotifyType.Reply_IconUpload:
            {
                IconInfo newIcon = (IconInfo)baseInfo;

                IconInfo iconInfo = iconInfoList.Find(item => item.Id == newIcon.Id);
                if (iconInfo == null)
                {
                    iconInfoList.Add(newIcon);

                    selectGrid.Children.Clear();
                    AlbermControl albermControl = new AlbermControl();
                    albermControl.pictureList(iconInfoList);
                    selectGrid.Children.Add(albermControl);
                }
            }
            break;

            case NotifyType.Reply_Give:
            {
                PresentHistoryInfo presentHistoryInfo = (PresentHistoryInfo)baseInfo;

                presentHistoryList.Add(presentHistoryInfo);
                selectGrid.Children.Clear();
                InnerControl innerControl = new InnerControl();
                innerControl.InnerChatting(chatHistoryList);
                selectGrid.Children.Add(innerControl);



                for (int i = 0; i < userInfoList.Count; i++)
                {
                    if (userInfoList[i].Id == presentHistoryInfo.ReceiveId)
                    {
                        userInfoList[i].Cash = userInfoList[i].Cash + presentHistoryInfo.Cash;

                        selectGrid.Children.Clear();
                        NoticeMemberControl noticeMemberControl = new NoticeMemberControl();
                        noticeMemberControl.listMember(userInfoList);
                        selectGrid.Children.Add(noticeMemberControl);

                        break;
                    }
                }
            }
            break;

            case NotifyType.Reply_UpdatePercent:
            {
                UserInfo userPercent = (UserInfo)baseInfo;
                if (userPercent.Id == Login._UserInfo.Id)
                {
                    selectGrid.Children.Clear();
                    MyInfoControl myInfoControl = new MyInfoControl();
                    myInfoControl.InitMyInfo(Login._UserInfo);
                    selectGrid.Children.Add(myInfoControl);
                }
            }
            break;

            case NotifyType.Reply_IconRemove:
            {
                IconInfo newIcon = (IconInfo)baseInfo;
                for (int i = 0; i < iconInfoList.Count; i++)
                {
                    if (iconInfoList[i].Icon == newIcon.Icon)
                    {
                        iconInfoList.Remove(iconInfoList[i]);
                    }
                }

                selectGrid.Children.Clear();
                AlbermControl albermControl = new AlbermControl();
                albermControl.pictureList(iconInfoList);
                selectGrid.Children.Add(albermControl);
            }
            break;

            case NotifyType.Reply_Error:
            {
                ResultInfo errorInfo = (ResultInfo)baseInfo;
                ErrorType  errorType = errorInfo.ErrorType;

                //Login.ShowError(errorType);
            }
            break;
            }
        }
Exemplo n.º 9
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Reply_UpdateUser:
            {
                UserInfo userName = (UserInfo)baseInfo;
                Window1.main.nickName.Content = userName.Nickname;

                ToolTip tt = new ToolTip();
                tt.Content = userName.Nickname;
                Window1.main.nickName.ToolTip = tt;

                IniFileEdit _IniFileEdit = new IniFileEdit(Window1._UserPath);

                ImageBrush updateImg = new ImageBrush();
                updateImg.Stretch = Stretch.Fill;
                _IniFileEdit.SetIniValue("UserInfo", "userImage", userName.Icon);
                updateImg.ImageSource       = ImageDownloader.GetInstance().GetImage(userName.Icon);
                myPicture.Fill              = updateImg;
                Window1.main.memberImg.Fill = updateImg;

                ToolTip sign = new ToolTip();
                sign.Content = Window1._UserInfo.Sign;
                Window1.main.singBox.ToolTip = sign;
                Window1.main.singBox.Text    = Window1._UserInfo.Sign;

                if (selectGrid.Children.Count > 0 && selectGrid.Children[0] is MyInfoControl)
                {
                    MyInfoControl myInfoControl = (MyInfoControl)selectGrid.Children[0];

                    myInfoControl.buttonSave.IsEnabled = false;
                }

                MessageBoxCommon.Show("更新成功", MessageBoxType.Ok);
            }
            break;

            case NotifyType.Reply_VideoUpload:
            {
                MessageBoxCommon.Show("更改成功.", MessageBoxType.Ok);
            }
            break;

            case NotifyType.Reply_NewID:
            {
                UserInfo newUserInfo = (UserInfo)baseInfo;
                MessageBoxCommon.Show("帐号申请通过." + newUserInfo.Id, MessageBoxType.Ok);
                userInfoList.Add(newUserInfo);

                selectGrid.Children.Clear();
                NoticeMemberControl noticeMemberControl = new NoticeMemberControl();
                noticeMemberControl.listMember(userInfoList);
                selectGrid.Children.Add(noticeMemberControl);
            }
            break;

            case NotifyType.Reply_IconUpload:
            {
                IconInfo newIcon = (IconInfo)baseInfo;
                iconInfoList.Add(newIcon);

                selectGrid.Children.Clear();
                AlbermControl albermControl = new AlbermControl();
                albermControl.pictureList(iconInfoList);
                selectGrid.Children.Add(albermControl);
            }
            break;

            case NotifyType.Reply_Give:
            {
                PresentHistoryInfo presentHistoryInfo = (PresentHistoryInfo)baseInfo;

                presentHistoryList.Add(presentHistoryInfo);
                selectGrid.Children.Clear();
                InnerControl innerControl = new InnerControl();
                innerControl.InnerChatting(chatHistoryList);
                selectGrid.Children.Add(innerControl);



                for (int i = 0; i < userInfoList.Count; i++)
                {
                    if (userInfoList[i].Id == presentHistoryInfo.ReceiveId)
                    {
                        userInfoList[i].Cash = userInfoList[i].Cash + presentHistoryInfo.Cash;

                        selectGrid.Children.Clear();
                        NoticeMemberControl noticeMemberControl = new NoticeMemberControl();
                        noticeMemberControl.listMember(userInfoList);
                        selectGrid.Children.Add(noticeMemberControl);

                        break;
                    }
                }
            }
            break;

            case NotifyType.Reply_UpdatePercent:
            {
                UserInfo userPercent = (UserInfo)baseInfo;
                if (userPercent.Id == Window1._UserInfo.Id)
                {
                    selectGrid.Children.Clear();
                    MyInfoControl myInfoControl = new MyInfoControl();
                    myInfoControl.InitMyInfo(Window1._UserInfo);
                    selectGrid.Children.Add(myInfoControl);
                }
            }
            break;

            case NotifyType.Reply_IconRemove:
            {
                IconInfo newIcon = (IconInfo)baseInfo;
                for (int i = 0; i < iconInfoList.Count; i++)
                {
                    if (iconInfoList[i].Icon == newIcon.Icon)
                    {
                        iconInfoList.Remove(iconInfoList[i]);
                    }
                }

                selectGrid.Children.Clear();
                AlbermControl albermControl = new AlbermControl();
                albermControl.pictureList(iconInfoList);
                selectGrid.Children.Add(albermControl);
            }
            break;

            case NotifyType.Reply_Error:
            {
                ResultInfo errorInfo = (ResultInfo)baseInfo;
                ErrorType  errorType = errorInfo.ErrorType;

                //Window1.ShowError(errorType);
            }
            break;
            }
        }