Ejemplo n.º 1
0
        private void OpenForm()
        {
            main = new Main();
            main.nickName.Content = _UserInfo.Nickname;
            ToolTip tt = new ToolTip();

            tt.Content            = _UserInfo.Nickname;
            main.nickName.ToolTip = tt;

            ImageBrush myIconImg = new ImageBrush();

            myIconImg.Stretch     = Stretch.Fill;
            myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(_UserInfo.Icon);

            main.memberImg.Fill = myIconImg;

            ToolTip sign = new ToolTip();

            sign.Content         = _UserInfo.Sign;
            main.singBox.ToolTip = sign;
            main.singBox.Text    = _UserInfo.Sign;

            _IniFileEdit.SetIniValue("UserInfo", "userImage", _UserInfo.Icon);

            Window1._ClientEngine.Send(NotifyType.Request_UserList, _UserInfo);
            Window1._ClientEngine.Send(NotifyType.Request_Home, _UserInfo);

            main.Show();

            this.Hide();
        }
Ejemplo n.º 2
0
        private void IconListView()
        {
            iconwrapPanel.Children.Clear();

            for (int i = 1; i <= 60; i++)
            {
                var faceGrid = new Grid();
                faceGrid.Width  = 58;
                faceGrid.Height = 58;
                faceGrid.Margin = new Thickness(2, 2, 1, 2);

                Image icon = new Image();
                icon.Margin = new Thickness(0);
                icon.Width  = 58;
                icon.Height = 58;
                icon.Cursor = Cursors.Hand;
                string filePath = string.Format("image/face/{0}", i + ".gif");
                icon.DataContext = filePath;
                icon.Source      = ImageDownloader.GetInstance().GetImage(filePath);
                //icon.Source = ImageDownloader.GetInstance().GetImage(Window1._UserInfo.Icon);
                icon.MouseLeftButtonDown += new MouseButtonEventHandler(icon_MouseUp);


                faceGrid.Children.Add(icon);
                iconwrapPanel.Children.Add(faceGrid);
            }
        }
Ejemplo n.º 3
0
        public void InitTabSetting(UserInfo userInfo)
        {
            if (userInfo != null)
            {
                selectUser = userInfo;

                ImageBrush faceImage = new ImageBrush();
                faceImage.Stretch     = Stretch.Fill;
                faceImage.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
                myPicture.Fill        = faceImage;

                ListBoxItem item1 = new ListBoxItem();
                item1.Content  = "信息";
                item1.MouseUp += new MouseButtonEventHandler(item1_MouseUp);
                ListBoxItem item2 = new ListBoxItem();
                item2.Content  = "相 册";
                item2.MouseUp += new MouseButtonEventHandler(item2_MouseUp);
                //ListBoxItem item3 = new ListBoxItem();
                //item3.Content = "评 价";
                //item3.MouseUp += new MouseButtonEventHandler(item3_MouseUp);
                ListBoxItem item4 = new ListBoxItem();

                listBox1.Items.Add(item1);

                if (userInfo.Kind == (int)UserKind.ServiceWoman)
                {
                    //item4.Content = "视频";
                    //item4.MouseUp += new MouseButtonEventHandler(item4_MouseUp);
                    listBox1.Items.Add(item2);
                    //listBox1.Items.Add(item3);
                    //listBox1.Items.Add(item4);
                }
            }
        }
Ejemplo n.º 4
0
        public void RoomListGrid(RoomInfo roomInfo)
        {
            _roomInfo = roomInfo;
            if (roomInfo.Point == 0)
            {
                if (Window1._UserInfo.Kind == (int)UserKind.ServiceWoman)
                {
                    BitmapImage roomBit = new BitmapImage();
                    roomBit.BeginInit();
                    roomBit.UriSource = new Uri("image/default.gif", UriKind.RelativeOrAbsolute);
                    roomBit.EndInit();
                    roomIcon.Source = roomBit;
                }
                else
                {
                    for (int i = 0; i < Window1.userList.Count; i++)
                    {
                        if (Window1.userList[i].Id == roomInfo.Owner)
                        {
                            roomIcon.Source = ImageDownloader.GetInstance().GetImage(Window1.userList[i].Icon);
                            break;
                        }
                    }
                }


                _roomPass = roomInfo.RoomPass;
                _roomId   = roomInfo.Id;
                _ownerId  = roomInfo.Owner;

                ToolTip roomToolTip = new ToolTip();
                roomToolTip.Content = roomInfo.Name + "(" + roomInfo.Id + ")";
                roomName.ToolTip    = roomToolTip;

                roomName.Content  = roomInfo.Name;
                roomCount.Content = roomInfo.UserCount.ToString();
                //roomCount.Content = roomInfo.UserCount.ToString() + "/" + roomInfo.MaxUsers.ToString();
                //roomValue.Content = roomInfo.Cash.ToString();
            }
            else
            {
                BitmapImage roomBit = new BitmapImage();
                roomBit.BeginInit();
                roomBit.UriSource = new Uri("image/pointRoom.gif", UriKind.RelativeOrAbsolute);
                roomBit.EndInit();
                roomIcon.Source = roomBit;

                _roomId  = roomInfo.Id;
                _ownerId = roomInfo.Id;

                ToolTip roomToolTip = new ToolTip();
                roomToolTip.Content = roomInfo.Name + "(" + roomInfo.Id + ")";
                roomName.ToolTip    = roomToolTip;

                roomName.Content  = roomInfo.Name;
                roomCount.Content = roomInfo.UserCount.ToString();
                //roomCount.Content = roomInfo.UserCount.ToString() + "/" + roomInfo.MaxUsers.ToString();
                //roomValue.Content = roomInfo.Point;
            }
        }
Ejemplo n.º 5
0
        public void selectUserInfo(UserInfo userinfo)
        {
            selecGridtUser = userinfo;
            Image userImg = new Image();

            //userImg.MouseUp += new MouseButtonEventHandler(userImg_MouseUp);
            userImg.Cursor  = Cursors.Hand;
            userImg.Stretch = Stretch.Fill;

            userImg.Source = ImageDownloader.GetInstance().GetImage(userinfo.Icon);
            imageGrid.Children.Add(userImg);

            userSign.Text    = "[" + userinfo.Id + "]" + " " + userinfo.Nickname;
            userName.Content = userinfo.Nickname;
            ago.Content      = (DateTime.Now.Year - userinfo.Year).ToString();
            address.Content  = userinfo.Address;

            if (userinfo.Visitors != 0)
            {
                count.Content = (int)((userinfo.Evaluation / (double)userinfo.Visitors) * 100) + "%";
            }
            else
            {
                count.Content = 0 + "%";
            }
            textBlock1.Text = userinfo.Sign;
        }
Ejemplo n.º 6
0
        public void InitTabSetting(UserInfo userInfo)
        {
            ImageBrush faceImage = new ImageBrush();

            faceImage.Stretch     = Stretch.Fill;
            faceImage.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
            myPicture.Fill        = faceImage;
            myPicture.Cursor      = Cursors.Hand;

            //ListBoxItem item1 = new ListBoxItem();
            //item1.Content = "银行信息";
            //item1.MouseUp += new MouseButtonEventHandler(item1_MouseUp);
            ListBoxItem item2 = new ListBoxItem();

            item2.FocusVisualStyle = null;
            item2.Content          = "消费记录";
            item2.MouseUp         += new MouseButtonEventHandler(item2_MouseUp);
            //ListBoxItem item3 = new ListBoxItem();
            //item3.Content = "结    算";
            //item3.MouseUp += new MouseButtonEventHandler(item3_MouseUp);
            ListBoxItem item4 = new ListBoxItem();

            item4.FocusVisualStyle = null;
            item4.Content          = "积分兑换";
            item4.MouseUp         += new MouseButtonEventHandler(item4_MouseUp);


            //listBox1.Items.Add(item1);
            listBox1.Items.Add(item2);
            //listBox1.Items.Add(item3);
            listBox1.Items.Add(item4);
        }
Ejemplo n.º 7
0
        public void InitVideoList(List <IconInfo> videoLsit)
        {
            if (videoLsit != null)
            {
                for (int i = 0; i < videoLsit.Count; i++)
                {
                    if (videoLsit[i].Icon.Contains("Videos") == true)
                    {
                        try
                        {
                            char[]   delimiterChars = { '\\', '.' };
                            string[] imgwords       = videoLsit[i].Icon.Split(delimiterChars);
                            int      imgcount       = imgwords.Length;
                            string   imgName        = imgwords[imgcount - 2].ToString();

                            Image videoImg = new Image();
                            videoImg.Width  = 85;
                            videoImg.Height = 63;
                            videoImg.Cursor = System.Windows.Input.Cursors.Hand;
                            videoImg.Margin = new Thickness(2, 2, 2, 2);
                            string fileName = "\\Videos\\" + imgName + ".gif";
                            videoImg.Source                = ImageDownloader.GetInstance().GetImage(fileName);
                            videoImg.DataContext           = videoLsit[i].Icon;
                            videoImg.MouseLeftButtonDown  += new System.Windows.Input.MouseButtonEventHandler(videoImg_MouseDown);
                            videoImg.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(videoImg_MouseRightButtonDown);
                            wrapPanel1.Children.Add(videoImg);
                        }
                        catch (Exception ex)
                        {
                            string strMsg = ex.Message;
                        }
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public Window1()
        {
            InitializeComponent();
            this.SetLanguageDictionary();

            InitSetting();

            _ClientEngine.Connect(_ServerUri, _ServerPort, ProtocolType.Tcp);
            _ClientEngine.AttachHandler(NotifyOccured);

            _VideoEngine.Connect(_ServerUri, Convert.ToInt32(_ServerPort), 1);

            StartTimer();
            //_ClientEngine.Send(NotifyType.Request_Home, _UserInfo);

            ImageBrush myIconImg = new ImageBrush();

            myIconImg.Stretch = Stretch.Fill;

            icon = _IniFileEdit.GetIniValue("UserInfo", "userImage");
            myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(icon);
            logimg.Fill           = myIconImg;

            txtUserName.Focus();
        }
        public void selPictureList(UserDetailInfo user)
        {
            wrapPanel1.Children.Clear();

            for (int i = 0; i < user.Faces.Count; i++)
            {
                string   video          = user.Faces[i].Icon;
                char[]   delimiterChars = { ':', '\\' };
                string[] words          = video.Split(delimiterChars);
                int      count          = words.Length;

                if (words[count - 2].ToString() == "Face")
                {
                    var faceGrid = new Grid();
                    faceGrid.Width  = 82;
                    faceGrid.Height = 81;
                    faceGrid.Margin = new Thickness(0);

                    Image finalImage = new Image();
                    finalImage.Cursor             = Cursors.Hand;
                    finalImage.Margin             = new Thickness(2, 1, 2, 1);
                    finalImage.DataContext        = user.Faces[i].Icon;
                    finalImage.Source             = ImageDownloader.GetInstance().GetImage(user.Faces[i].Icon);
                    finalImage.MouseLeftButtonUp += new MouseButtonEventHandler(finalImage_MouseLeftButtonUp);
                    faceGrid.Children.Add(finalImage);
                    wrapPanel1.Children.Add(faceGrid);
                }
            }
        }
Ejemplo n.º 10
0
        public void InitTabSetting(UserInfo userInfo)
        {
            ImageBrush faceImage = new ImageBrush();

            faceImage.Stretch     = Stretch.Fill;
            faceImage.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
            myPicture.Fill        = faceImage;
            myPicture.Cursor      = Cursors.Hand;

            ListBoxItem item1 = new ListBoxItem();

            item1.Content  = "我的信息";
            item1.MouseUp += new MouseButtonEventHandler(item1_MouseUp);
            ListBoxItem item2 = new ListBoxItem();

            if (Window1._UserInfo.Kind == (int)UserKind.ServiceWoman)
            {
                item2.Content = "相 册";
            }
            else
            {
                item2.Content = "更换头像";
            }
            item2.MouseUp += new MouseButtonEventHandler(item2_MouseUp);
            ListBoxItem item3 = new ListBoxItem();

            item3.Content  = "评  价";
            item3.MouseUp += new MouseButtonEventHandler(item3_MouseUp);
            ListBoxItem item4 = new ListBoxItem();

            item4.Content  = "会员信息";
            item4.MouseUp += new MouseButtonEventHandler(item4_MouseUp);

            ListBoxItem item6 = new ListBoxItem();

            item6.Content  = "我的视频";
            item6.MouseUp += new MouseButtonEventHandler(item4_1_MouseUp);

            ListBoxItem item5 = new ListBoxItem();

            item5.Content  = "充值信息";
            item5.MouseUp += new MouseButtonEventHandler(item5_MouseUp);


            listBox1.Items.Add(item1);
            listBox1.Items.Add(item2);
            if (userInfo.Kind == (int)UserKind.ServiceWoman)
            {
                listBox1.Items.Add(item3);
                listBox1.Items.Add(item6);
            }
            listBox1.Items.Add(item4);
            listBox1.Items.Add(item5);
        }
Ejemplo n.º 11
0
        void item1_Click(object sender, RoutedEventArgs e)
        {
            var        selectMenu    = sender as MenuItem;
            string     imgIcon       = selectMenu.DataContext.ToString();
            ImageBrush selectIconImg = new ImageBrush();

            selectIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(imgIcon);

            Window1.myhome.myPicture.Fill = selectIconImg;
            Window1._UserInfo.Icon        = imgIcon;
            Window1._ClientEngine.Send(NotifyType.Request_UpdateUser, Window1._UserInfo);
        }
Ejemplo n.º 12
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Reply_Login:
            {
                PB9.Visibility        = Visibility.Hidden;
                lblWaiting.Visibility = Visibility.Visible;
                _UserInfo             = (UserInfo)baseInfo;

                main = new Main();
                main.nickName.Content = _UserInfo.Nickname;
                ToolTip tt = new ToolTip();
                tt.Content            = _UserInfo.Nickname;
                main.nickName.ToolTip = tt;

                ImageBrush myIconImg = new ImageBrush();

                myIconImg.Stretch     = Stretch.Fill;
                myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(_UserInfo.Icon);

                main.memberImg.Fill = myIconImg;

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

                _IniFileEdit.SetIniValue("UserInfo", "userImage", _UserInfo.Icon);

                Window1._ClientEngine.Send(NotifyType.Request_UserList, _UserInfo);
                Window1._ClientEngine.Send(NotifyType.Request_Home, _UserInfo);

                Window1._ClientEngine.Send(NotifyType.Request_GameList, _UserInfo);
                Window1._ClientEngine.Send(NotifyType.Request_RoomList, _UserInfo);

                main.Show();

                this.Hide();
            }
            break;

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

                Window1.ShowError(errorType);
            }
            break;
            }
        }
Ejemplo n.º 13
0
        public void ViewImage(string imageName)
        {
            imageGrid.Children.Clear();
            Image img = new Image();

            img.Source = ImageDownloader.GetInstance().GetImage(imageName);
            double widthImg  = img.Source.Width;
            double heightImg = img.Source.Height;

            imageGrid.Children.Add(img);

            this.Width  = widthImg;
            this.Height = heightImg;
        }
Ejemplo n.º 14
0
        public void ChattingInfo(string name, string icon, string price, string content, string id, double mark)
        {
            reciveId = id;
            //녀성사진
            ImageBrush faceImage = new ImageBrush();

            faceImage.Stretch     = Stretch.Fill;
            faceImage.ImageSource = ImageDownloader.GetInstance().GetImage(icon);
            myPicture.Fill        = faceImage;

            nickName.Content   = name;
            pricestate.Content = price;
            marklabel.Content  = mark.ToString() + "%";
            textBlock1.Text    = content;
        }
Ejemplo n.º 15
0
        public Login()
        {
            InitializeComponent();

            this.SetLanguageDictionary();

            InitSetting();
            InitMainResourceDic(); // WindowStyle Setting

            CheckUpdate();

            _ClientEngine = new Client(InvokeSocket);

            if (!_ClientEngine.Connect(_ServerUri, _ServerPort, ProtocolType.Tcp))
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "服务器连接失败", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);

                Environment.Exit(0);
            }

            _ClientEngine.AttachHandler(NotifyOccured);

            StartTimer();

            ImageBrush myIconImg = new ImageBrush();

            myIconImg.Stretch = Stretch.Fill;

            icon = _IniFileEdit.GetIniValue("UserInfo", "userImage");

            BitmapImage bi = new BitmapImage();

            bi.BeginInit();
            bi.UriSource = new Uri(icon, UriKind.RelativeOrAbsolute);
            bi.EndInit();

            myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(icon);
            logimg.Fill           = myIconImg;

            txtUserName.Focus();


            // 2014-06-15: GreenRose
            DeleteDataFolder();
        }
Ejemplo n.º 16
0
        public void InitUserCtrl(ChatEngine.GameInfo gameInfo)
        {
            _gameInfo = gameInfo;

            lbl_GameName.Content = gameInfo.GameName;
            img_GameIcon.Source  = ImageDownloader.GetInstance().GetImage(gameInfo.Icon);

            bool bDownloaded = CheckDownloadState(_gameInfo);

            if (bDownloaded)
            {
                img_GameIcon.Opacity = 0.8;
            }
            else
            {
                img_GameIcon.Opacity         = 0.2;
                img_GamePointIcon.Visibility = Visibility.Hidden;
                img_GameCashIcon.Source      = new BitmapImage(new Uri("pack://application:,,,/Resources;component/image/Download-icon.png", UriKind.RelativeOrAbsolute));
            }
        }
Ejemplo n.º 17
0
        public void UserListGrid(UserInfo userInfo)
        {
            Main.selectUserInfo = userInfo;
            ImageBrush iconUser = new ImageBrush();

            iconUser.Stretch = Stretch.Fill;

            iconUser.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
            userIcon.Fill        = iconUser;


            //if (userInfo.RoomId == "")
            //{
            //    chattingState.Content = "等候";
            //    chattingState.Foreground = new SolidColorBrush(Colors.Green);
            //}
            //else
            //{
            //    chatState = false;
            //    chattingState.Content = "聊天中";
            //    chattingState.Foreground = new SolidColorBrush(Colors.Red);
            //    chatIcon.Opacity = 0.5;
            //    chatIcon.IsEnabled = false;
            //}


            ToolTip nameToolTip = new ToolTip();

            nameToolTip.Content = userInfo.Id + "   " + "(" + userInfo.Nickname + ")";
            userNick.ToolTip    = nameToolTip;
            userNick.Content    = userInfo.Id + "   " + "(" + userInfo.Nickname + ")";

            ToolTip singToolTip = new ToolTip();

            singToolTip.Content = userInfo.Sign;
            userSign.ToolTip    = singToolTip;
            userSign.Content    = userInfo.Sign;
            userVisite.Content  = userInfo.Visitors.ToString();

            _userId = userInfo.Id;
        }
Ejemplo n.º 18
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Reply_Login:
            {
                _UserInfo = (UserInfo)baseInfo;

                if (main != null)
                {
                    return;
                }

                SavePass();

                PB9.Visibility        = Visibility.Hidden;
                lblWaiting.Visibility = Visibility.Visible;


                main = new Main();

                if (_UserInfo.Nickname == string.Empty)
                {
                    main.nickName.Content = "未知昵称";
                }
                else
                {
                    main.nickName.Content = _UserInfo.Nickname;
                }
                main.nickName.Content += "(" + _UserInfo.Id + ")";
                ToolTip tt = new ToolTip();
                tt.Content            = _UserInfo.Nickname;
                main.nickName.ToolTip = tt;

                main.txtCash.Text     = _UserInfo.Cash.ToString();
                main.txtPoint.Text    = _UserInfo.Point.ToString();
                main.txtRenminbi.Text = (Login._UserInfo.Cash / 100 + Login._UserInfo.Point / 10000).ToString();

                ImageBrush myIconImg = new ImageBrush();

                myIconImg.Stretch     = Stretch.Fill;
                myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(_UserInfo.Icon);

                main.memberImg.Fill = myIconImg;

                ToolTip sign = new ToolTip();
                if (_UserInfo.Sign == string.Empty)
                {
                    _UserInfo.Sign = "未知的标志";
                }

                System.Windows.Documents.FlowDocument fd = new System.Windows.Documents.FlowDocument();
                fd.Blocks.Add(new System.Windows.Documents.Paragraph(new System.Windows.Documents.Run(_UserInfo.Sign)));
                main.singBox.Document = fd;

                _IniFileEdit.SetIniValue("UserInfo", "userImage", _UserInfo.Icon);

                Login._ClientEngine.Send(NotifyType.Request_Home, _UserInfo);

                main.Show();

                this.Hide();
            }
            break;

            case NotifyType.Reply_AdminNotice:
            {
                BoardInfo boardInfo = (BoardInfo)baseInfo;
                if (main != null)
                {
                    if (boardInfo != null)
                    {
                        if (boardInfo.Content != "")
                        {
                            main.searchTextBox.Text = boardInfo.Content;
                            main.RightToLeftMarquee();
                        }
                        else
                        {
                            main.searchTextBox.Text = "Unknown Notice";
                            main.RightToLeftMarquee();
                        }
                    }
                }
            }
            break;

            case NotifyType.Reply_Error:
            {
                if (Main.loadWnd != null)
                {
                    Main.loadWnd.Close();
                    Main.loadWnd = null;
                }

                btnLogIn.IsEnabled = true;
                ResultInfo errorInfo = (ResultInfo)baseInfo;
                ErrorType  errorType = errorInfo.ErrorType;

                if (errorType == ErrorType.Duplicate_logout)
                {
                    Login._ClientEngine._NotifyHandler(NotifyType.Notify_Duplicate, null, null);
                    break;
                }

                Login.ShowError(errorType);
            }
            break;
            }
        }
Ejemplo n.º 19
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;
            }
        }
Ejemplo n.º 20
0
        public void UserListGrid(UserInfo userInfo)
        {
            Main.selectUserInfo = userInfo;
            ImageBrush iconUser = new ImageBrush();

            iconUser.Stretch     = Stretch.Fill;
            iconUser.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
            //userIcon.Fill = iconUser;
            //userIcon.Background = iconUser;
            brUserIcon.Background = iconUser;

            //if (userInfo.RoomId == "")
            //{
            //    chattingState.Content = "等候";
            //    chattingState.Foreground = new SolidColorBrush(Colors.Green);
            //}
            //else
            //{
            //    chatState = false;
            //    chattingState.Content = "聊天中";
            //    chattingState.Foreground = new SolidColorBrush(Colors.Red);
            //    chatIcon.Opacity = 0.5;
            //    chatIcon.IsEnabled = false;
            //}


            //ToolTip nameToolTip = new ToolTip();
            //nameToolTip.Content = userInfo.Id + "   " + "(" + userInfo.Nickname + ")";
            //userNick.ToolTip = nameToolTip;
            //userNick.Content = userInfo.Id + "   " + "(" + userInfo.Nickname + ")";
            //userNick.Content = userInfo.Nickname + "   " + "(" + userInfo.Id + ")";
            userNick.Content = userInfo.Nickname;

            ToolTip singToolTip = new ToolTip();

            singToolTip.Content = userInfo.Sign;
            //userSign.ToolTip = singToolTip;
            userSign.Content = userInfo.Sign;
            //userVisite.Content = userInfo.Visitors.ToString();

            _userId = userInfo.Id;

            BitmapImage bi = new BitmapImage();

            switch (userInfo.nUserState)
            {
            case 0:
            {
                bi.BeginInit();
                bi.UriSource = new Uri("/Resources;component/Icons/imonline.ico", UriKind.RelativeOrAbsolute);
                bi.EndInit();

                imgUserState.Source = bi;
            }
            break;

            case 1:
            {
                bi.BeginInit();
                bi.UriSource = new Uri("/Resources;component/Icons/imoffline.ico", UriKind.RelativeOrAbsolute);
                bi.EndInit();

                imgUserState.Source = bi;
            }
            break;

            case 2:
            {
                bi.BeginInit();
                bi.UriSource = new Uri("/Resources;component/Icons/busy.ico", UriKind.RelativeOrAbsolute);
                bi.EndInit();

                imgUserState.Source = bi;
            }
            break;

            case 3:
            {
                bi.BeginInit();
                bi.UriSource = new Uri("/Resources;component/Icons/away.ico", UriKind.RelativeOrAbsolute);
                bi.EndInit();

                imgUserState.Source = bi;
            }
            break;
            }
        }
Ejemplo n.º 21
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;
            }
        }
Ejemplo n.º 22
0
        public void InitTabSetting(UserInfo userInfo)
        {
            ImageBrush faceImage = new ImageBrush();

            faceImage.Stretch     = Stretch.Fill;
            faceImage.ImageSource = ImageDownloader.GetInstance().GetImage(userInfo.Icon);
            myPicture.Fill        = faceImage;
            //myPicture.Cursor = Cursors.Hand;

            ListBoxItem item1 = new ListBoxItem();

            item1.Content          = "我的信息";
            item1.FocusVisualStyle = null;
            item1.MouseUp         += new MouseButtonEventHandler(item1_MouseUp);

            ListBoxItem item2 = new ListBoxItem();

            item1.FocusVisualStyle = null;
            if (Login._UserInfo.Kind == (int)UserKind.ServiceWoman)
            {
                item2.Content = "相 册";
            }
            else
            {
                item2.Content = "更换头像";
            }
            item2.MouseUp += new MouseButtonEventHandler(item2_MouseUp);

            ListBoxItem item3 = new ListBoxItem();

            item3.Content  = "修改密码";
            item3.MouseUp += new MouseButtonEventHandler(item3_MouseUp);

            //ListBoxItem item4 = new ListBoxItem();
            //item4.Content = "会员信息";
            //item4.MouseUp += new MouseButtonEventHandler(item4_MouseUp);

            ListBoxItem item6 = new ListBoxItem();

            item6.Content  = "视频录制";
            item6.MouseUp += new MouseButtonEventHandler(item4_1_MouseUp);

            ListBoxItem item5 = new ListBoxItem();

            item5.Content  = "视频设置";
            item5.MouseUp += new MouseButtonEventHandler(item5_MouseUp);

            ListBoxItem item7 = new ListBoxItem();

            item1.FocusVisualStyle = null;
            item7.Content          = "更换头像";
            item7.MouseUp         += new MouseButtonEventHandler(item7_MouseUp);

            listBox1.Items.Add(item1);
            listBox1.Items.Add(item3);
            listBox1.Items.Add(item2);
            if (userInfo.Kind == (int)UserKind.ServiceWoman)
            {
                //listBox1.Items.Add(item3);
                //listBox1.Items.Add(item6);
                listBox1.Items.Add(item7);
            }
            listBox1.Items.Add(item5);
            //listBox1.Items.Add(item4);
            //listBox1.Items.Add(item5);
        }