//双击好有时
        private void chatShow_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;
            item.IsTwinkle = false;

            //bool isFormexist;
            string windowsName = "与 " + item.NicName + " 对话中";
            IntPtr handle = NativeMethods.FindWindow(null, windowsName);
            if (handle != IntPtr.Zero)
            {
                Form frm = (Form)Form.FromHandle(handle);
                frm.Activate();
            }
            else
            {
                //ipSend为从列表中取出,要发送的对象的IP
                string ipSend = item.IpAddress;
                string nameSend = item.DisplayName;
                string idSend = item.NicName;
                string mesSend = string.Empty;
                FrmChat fChat = new FrmChat(ipSend, nameSend, idSend, mesSend);
                //fChat.Name = lvItem.SubItems[0].Text;
                fChat.Text = "与 " + item.NicName + " 对话中";
                fChat.Show();
            }
        }
Exemple #2
0
 private void listbox_clients_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     if (listbox_clients.Items[0].SubItems[0].Status== ChatListSubItem.UserStatus.OffLine)
     {
         showInfo("你处于离线状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (listbox_clients.Items[0].SubItems[0].IsVip)
     {
         showInfo("你处于远程控制状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (e.SelectSubItem.DisplayName.Equals(label_nickname.Text))
     {
         showInfo("设备不能连接自身", MyConfig.INT_UPDATEUI_TXBOX);
         //return;
     }
     if (e.SelectSubItem.Status==ChatListSubItem.UserStatus.OffLine)
     {
         showInfo("你连接的远端设备不在线", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (e.SelectSubItem.IsVip)
     {
         showInfo("你连接的远端设备处于控制状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     connect(e.SelectSubItem.Tag.ToString());
 }
Exemple #3
0
        private void chatListBox_group_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            var item  = e.SelectSubItem;
            var group = (IGroup)item.Tag;

            item.IsTwinkle = false;

            if (this.GroupDoubleClicked != null)
            {
                this.GroupDoubleClicked(group);
            }
        }
Exemple #4
0
        /// <summary>
        /// 私聊
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void friendsList_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;

            item.IsTwinkle = false;
            string     name        = item.DisplayName;
            GGUserInfo receiveUser = new GGUserInfo()
            {
                userNickName = name, iPEndPoint = new IPEndPoint(IPAddress.Parse("10.10.19.5"), new Random().Next(1000, 9999))
            };
            ChatForm f = new ChatForm(user, receiveUser, this);

            f.Show();
        }
Exemple #5
0
        private void chatListBoxFriend_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem subItem = e.SelectSubItem;

            if (!Util.ChatFormHashtable.ContainsKey(subItem.JidUser))
            {
                RibbonFormChat formChat = new RibbonFormChat(_connection,
                                                             new Jid(subItem.JidUser)
                {
                    Resource = subItem.Resource
                }, subItem.NicName);
                formChat.Show();
            }
        }
Exemple #6
0
        private void chatShow_MouseLeaveHead(object sender, ChatListEventArgs e)
        {
            if (this.userInformationForm == null)
            {
                return;
            }

            Thread.Sleep(100);
            var form = (Form)this.userInformationForm;

            if (!form.Bounds.Contains(Cursor.Position))
            {
                form.Hide();
            }
        }
Exemple #7
0
        private void chatShow_MouseEnterHead(object sender, ChatListEventArgs e)
        {
            if (this.userInformationForm == null)
            {
                return;
            }

            var item = e.MouseOnSubItem;

            if (item == null)
            {
                item = e.SelectSubItem;
            }

            var loc = this.PointToScreen(this.Location);

            //int top = this.Top + this.chatListBox.Top + (item.HeadRect.Y - this.chatListBox.chatVScroll.Value);
            //int left = this.Left - 279 - 5;
            var top  = loc.Y + (item.HeadRect.Y - this.chatListBox.chatVScroll.Value) - this.Location.Y;
            var left = loc.X - 279 - 5;

            //int ph = Screen.GetWorkingArea(this).Height;

            //if (top + 181 > ph)
            //{
            //    top = ph - 181 - 5;
            //}

            if (left < 0)
            {
                left = this.Right + 5;
            }

            var user = (GGUser)item.Tag;
            var form = (Form)this.userInformationForm;

            this.userInformationForm.SetUser(user);
            form.Location = new Point(left, top);
            if (!this.firstShow)
            {
                form.Show();
            }
            else
            {
                this.firstShow = true;
            }
            form.Location = new Point(left, top);
        }
        private void clb_member_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
        {
            var userId = (long)e.SelectSubItem.ID;

            if (userId == Class1.UserId)
            {
                return;
            }
            frm_chat frm_chat;

            if (Class1.formChatPool.ContainsKey(userId))
            {
                frm_chat = Class1.formChatPool[userId];
                frm_chat.Activate();
            }
            else
            {
                frm_chat = new frm_chat(userId);
                Class1.formChatPool.Add(userId, frm_chat);
                frm_chat.Show();
            }
            if (Class1.unReadPrivateMsgItemPool.ContainsKey(userId))
            {
                var updateFriendLastReadMsgIdReq = new http._User_Relation.UpdateFriendLastReadMsgIdReq()
                {
                    UserId        = Class1.UserId,
                    LastReadMsgId = new Dictionary <long, long>()
                };
                var subItem = Class1.unReadPrivateMsgItemPool[userId];
                var ids     = ((List <long>)(((Dictionary <string, object>)subItem.Tag)["ids"]));
                foreach (var id in ids)
                {
                    if (updateFriendLastReadMsgIdReq.LastReadMsgId.ContainsKey(userId))
                    {
                        updateFriendLastReadMsgIdReq.LastReadMsgId[userId] = Math.Max(updateFriendLastReadMsgIdReq.LastReadMsgId[userId], id);
                    }
                    else
                    {
                        updateFriendLastReadMsgIdReq.LastReadMsgId.Add(userId, id);
                    }
                }
                http._User_Relation.UpdateFriendLastReadMsgId(updateFriendLastReadMsgIdReq);

                Class1.frmMsgBox.clb_unread_msg.Items[0].SubItems.Remove(subItem);
                Class1.unReadPrivateMsgItemPool.Remove(userId);
                icon.ChangeIconState();
            }
        }
Exemple #9
0
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            var item   = e.SelectSubItem;
            var friend = (GGUser)item.Tag;

            item.IsTwinkle = false;

            if (friend.ID == this.currentUser.ID)
            {
                return;
            }

            if (this.UserDoubleClicked != null)
            {
                this.UserDoubleClicked(friend);
            }
        }
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            string userID = e.SelectSubItem.ID;
            if (userID == this.currentUser.ID)
            {
                return;
            }

            if (this.mainForm.IsFriend(userID))
            {
                ChatForm form = (ChatForm)this.mainForm.GetChatForm(userID);
                form.Show();
            }
            else
            {
                this.mainForm.AddFriend(userID);
            }
        }
Exemple #11
0
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            string userID = e.SelectSubItem.ID;
            if (userID == this.currentUser.ID)
            {
                return;
            }

            if (this.mainForm.IsFriend(userID))
            {
                ChatForm form = (ChatForm)this.mainForm.GetChatForm(userID);
                form.Show();
            }
            else
            {
                this.mainForm.AddFriend(userID);
            }
        }         
Exemple #12
0
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            //Parameter<string, bool> para = RecentListBox.ParseIDFromRecentID(e.SelectSubItem.ID);

            //if (this.UnitDoubleClicked != null)
            //{
            //    this.UnitDoubleClicked(para.Arg1, para.Arg2);
            //}


            ChatListSubItem item = this.chatListBox.SelectSubItem;

            item.IsTwinkle = false;
            if (this.UnitDoubleClicked != null)
            {
                this.UnitDoubleClicked(item);
            }
        }
        private void chatListBox1_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;

            item.IsTwinkle = false;

            string friendID = item.ID;

            if (friendID == this.rapidPassiveEngine.CurrentUserID)
            {
                return;
            }

            ChatForm form = this.ggSupporter.GetChatForm(friendID);

            form.Show();
            form.Focus();
        }
Exemple #14
0
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;

            //IUser friend = (IUser)item.Tag;
            item.IsTwinkle = false;


            //if (friend.ID == this.currentUser.ID)
            //{
            //    return;
            //}

            if (this.UserDoubleClicked != null)
            {
                this.UserDoubleClicked(item);
            }
        }
Exemple #15
0
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
        {
            ChatListSubItem item = e.SelectSubItem;                           //获取选中的好友

            item.IsTwinkle = false;                                           //取消头像闪烁状态
            string windowsName = item.NicName + ' ' + item.ID;                //聊天窗口的标题
            IntPtr handle      = NativeMethods.FindWindow(null, windowsName); //查找是否已经存在窗口

            if (handle != IntPtr.Zero)                                        //窗口已存在
            {
                Form frm = (Form)Form.FromHandle(handle);
                frm.Activate();//激活
            }
            else//窗口不存在
            {
                Form_Chat fChat = new Form_Chat(this.rapidPassiveEngine, item, this.myInfo, this);
                fChat.Text = item.NicName + ' ' + item.ID;
                fChat.Show();
            }
        }
Exemple #16
0
        private void chatListBox1_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
        {
            if (e.IsNull() || e.SelectSubItem == null || e.SelectSubItem.Tag == null)
            {
                return;
            }

            String userID = e.SelectSubItem.Tag.ToString();

            if (userID == "e.SelectSubItem")
            {
                FriendChatForm form = new FriendChatForm(userID);
                form.Show();
            }
            else
            {
                FriendChatForm form = new FriendChatForm(userID);
                form.Show();
            }
        }
Exemple #17
0
        /// <summary>
        /// 重点对象 列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void MajorFriendList_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            //获取历史消息.
            string fatherqq = e.SelectSubItem.Info.FatherNumber;
            string qqnum    = e.SelectSubItem.Info.QQNumber;

            if (_CurrentFriend != null &&
                _CurrentFriend.FatherNumber == fatherqq && _CurrentFriend.QQNumber == qqnum)
            {
                _IsHistoryFriend = true;
            }
            else
            {
                _IsHistoryFriend = false;
            }
            richMessageHistory.Text = _MsgRecord.FindContent(fatherqq, qqnum);

            //显示历史消息.
            splitContainerEx3.Expand();
        }
Exemple #18
0
        private void friendList_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;
            item.IsTwinkle = false;

            //bool isFormexist;
            string windowsName = "与 " + item.DisplayName + " 对话中";
            IntPtr handle = NativeMethods.FindWindow(null, windowsName);
            if (handle != IntPtr.Zero)
            {
                Form frm = (Form)Form.FromHandle(handle);
                frm.Activate();

            }
            else
            {
                TcpClient tc = new TcpClient();
                tc.Connect("127.0.0.1",8082);
                NetworkStream stream= tc.GetStream();

                byte [] onTmp=System.Text.Encoding.UTF8.GetBytes("Online:"+item.NicName);
                stream.Write(onTmp,0,onTmp.Length);

                byte[] ip = new byte[1024 * 80];
                int n=stream.Read(ip,0,1024*80);

                if (n != 0)
                {
                    string sIP = System.Text.Encoding.UTF8.GetString(ip, 0, n);

                    FrmChat frmChat = new FrmChat(item.DisplayName, item.NicName);
                    frmChat.Show();
                }
                else
                {
                    MessageBox.Show("此用户不在线!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                tc.Close();
            }
        }
Exemple #19
0
        //#region 向用户终端发送消息
        ////public void sendMsgToOneUser(ClassMsg msg, System.Net.IPAddress Ip, int Port)//发送消息到用户的一个联系人
        ////{
        ////    msg.ID = selfInfo.ID;//标识本人的ID号
        ////    this.sockUDP1.Send(Ip, Port, new ClassSerializers().SerializeBinary(msg).ToArray());
        ////}
        //#endregion

        //#region 接收数据方法
        //private void sockUDP1_DataArrival(byte[] Data, System.Net.IPAddress Ip, int Port)
        //{
        //    //DataArrivaldelegate outdelegate = new DataArrivaldelegate(DataArrival);
        //    //this.BeginInvoke(outdelegate, new object[] { Data, Ip, Port });
        //}

        //private delegate void DataArrivaldelegate(byte[] Data, System.Net.IPAddress Ip, int Port);

        ////private void DataArrival(byte[] Data, System.Net.IPAddress Ip, int Port)
        ////{
        ////    ClassMsg msg = new ClassSerializers().DeSerializeBinary((new System.IO.MemoryStream(Data))) as ClassMsg;
        ////    switch (msg.MsgInfoClass)
        ////    {
        ////        case -1:
        ////            //MessageBox.Show(msg.MsgContent);
        ////            break;
        ////        case 0://有用户离线
        ////            userSingnOut(msg.ID);//处理用户离线
        ////            break;
        ////        case 1://服务器告诉自己已经登录,登录过程
        ////            SuccessLogin(msg);
        ////            break;
        ////        case 2://服务器告诉用户自己目前在线
        ////            //updateSelfState();//更新当前用户在线状态
        ////            break;
        ////        case 3://服务器告诉用户有新的联系人登录
        ////            NewUserLogin(new ClassSerializers().DeSerializeBinary((new System.IO.MemoryStream(msg.MsgContent))) as ClassUserInfo);//添加新登录的用户资料
        ////            break;
        ////        case 4://收到用户部分联系人的资料
        ////            UsersDataArrival((new ClassSerializers().DeSerializeBinary((new System.IO.MemoryStream(msg.MsgContent))) as ClassUsers));//收到用户所有联系人的资料
        ////            break;
        ////        case 5://收到用户联系人发送来的对话消息
        ////            //UserChatArrival(msg, Ip, Port);//处理对话消息
        ////            break;
        ////        case 6://联系人返回已经收到刚才发送的对话消息
        ////            //returnChatArrival(msg.ID);//联系人返回已经收到刚才发送的对话消息
        ////            break;
        ////        case 7:
        ////            //收到联系人发送来的群发通知消息
        ////            //noticeArrival(msg, Ip, Port);//处理联系人发送来的群发通知消息
        ////            break;
        ////        case 10://收到联系人发出发送文件请求
        ////            //sendFileRequest(msg, Ip, Port);
        ////            break;
        ////        case 11://收到联系人发送来的gif图片流
        ////            //UserGifArrival(msg, Ip, Port);//处理gif图片消息
        ////            break;
        ////        case 12://收到用户发送来的文本消息
        ////            UserTextChatArrival(msg, Ip, Port);//处理用户发送来的文本消息
        ////            break;
        ////    }

        ////}

        ////private void UsersDataArrival(ClassUsers users)//收到用户所有联系人的资料
        ////{
        ////    ClassUserInfo UserInfo;
        ////    foreach (ClassUserInfo userinfo in users)
        ////    {
        ////        UserInfo = findUser(userinfo.ID);
        ////        if (userinfo.ID == selfInfo.ID)
        ////            break;//如果新登录的联系人是自己则退出
        ////        if (UserInfo == null)
        ////        {
        ////            this.MyUsers.add(userinfo);
        ////            ChatListSubItem subItem = new ChatListSubItem(userinfo.ID, userinfo.UserName, userinfo.AssemblyVersion,
        //ChatListSubItem.UserStatus.Online);
        ////            this.chatListBox.Items[1].SubItems.AddAccordingToStatus(subItem);
        ////            //updateGroupInfo(userinfo);


        ////        }
        ////        else
        ////        {
        ////            ClassUserInfo user = new ClassUserInfo();
        ////            user.ID = userinfo.ID;
        ////            user.IP = userinfo.IP;
        ////            user.Port = userinfo.Port;
        ////            user.AssemblyVersion = userinfo.AssemblyVersion;
        ////            this.UpdateUser(user);//更新用户状态

        ////            foreach (ChatListItem item in chatListBox.Items)
        ////            {
        ////                foreach (ChatListSubItem subItem in item.SubItems)
        ////                {
        ////                    if (subItem.Tag.ToString().ToLower() == user.ID.ToLower())
        ////                    {
        ////                        subItem.Status = ChatListSubItem.UserStatus.Online;
        ////                        break;
        ////                    }

        ////                }
        ////            }
        ////        }
        ////    }
        ////}
        ////private void UserTextChatArrival(ClassMsg msg, System.Net.IPAddress Ip, int Port)//处理用户发送来的文本消息
        ////{

        ////    ClassUserInfo userinfo = this.findUser(msg.ID);
        ////    if (userinfo != null)
        ////    {
        ////        string title = userinfo.UserName + "(" + System.DateTime.Now.ToString() + ")";
        ////        //MsgAddToDB(msgRtf,msg.ID,selfInfo.ID,msg.AssemblyVersion,System.DateTime.Now.ToString(),true);//将消息添加进数据库
        ////    //    foreach (System.Windows.Forms.Form form in forms)
        ////    //        if (form.Tag.ToString() == userinfo.ID)
        ////    //        {
        ////    //            frmchatMain f = (form as frmchatMain);
        ////    //            f.newTextMsg(msg.MsgContent, title, new System.Drawing.Font("宋体", 10), Color.Blue);
        ////    //            f.Activate();
        ////    //            return;
        ////    //        }

        ////    //    frmchatMain newf = new frmchatMain();
        ////    //    newf.Tag = msg.ID;
        ////    //    newf.Text = "与 " + userinfo.UserName + "(" + userinfo.ID + ") 对话";
        ////    //    newf.setUserName(userinfo.UserName);
        ////    //    newf.newTextMsg(msg.MsgContent, title, new System.Drawing.Font("宋体", 10), Color.Blue);
        ////    //    forms.add(newf);
        ////    //    //ShowNotifyIcon(1, "", "收到 " + userinfo.UserName + "(" + userinfo.ID + ") 发送给您的新消息。");
        ////    //    newf.Show();

        ////     }
        ////}
        //#endregion

        //#region 接收后信息的回调方法
        //private void userSingnOut(string msgID)
        //{


        //    //RemoveUser(msgID);
        //    foreach (ChatListSubItem subItem in this.chatListBox.Items[1].SubItems)
        //    {

        //        if (subItem.NicName == msgID)
        //        {
        //            subItem.Status = ChatListSubItem.UserStatus.OffLine;
        //            break;
        //        }
        //    }
        //    //this.chatListBox.Items[1].SubItems[0].Status = "";
        //}

        ////private void SuccessLogin(ClassMsg msg)//服务器告诉用户已经成功登录的处理过程
        ////{
        ////this.Text="成功登陆";
        ////ClassUserInfo self = (new ClassSerializers().DeSerializeBinary(new System.IO.MemoryStream(msg.MsgContent))) as ClassUserInfo;
        ////selfInfo.UserName = self.UserName;
        ////selfInfo.State = 1;

        ////ShowNotifyIcon(1,"","LanMsg已经成功登录服务器。");
        ////}

        ////private void NewUserLogin(ClassUserInfo userinfo)//添加新登录的用户资料
        ////{


        ////    if (userinfo.ID == selfInfo.ID)
        ////        return;//如果新登录的联系人是自己则退出
        ////    //this.Text="新用户"+ userinfo.ID;
        ////    ClassUserInfo UserInfo;
        ////    UserInfo = findUser(userinfo.ID);

        ////    if (UserInfo == null)
        ////    {
        ////        this.MyUsers.add(userinfo);
        ////        ChatListSubItem subItem = new ChatListSubItem(userinfo.ID, userinfo.UserName, userinfo.AssemblyVersion, ChatListSubItem.UserStatus.Online);
        ////        this.chatListBox.Items[1].SubItems.AddAccordingToStatus(subItem);

        ////        // 增加一个新用户
        ////    }
        ////    else
        ////    {
        ////        ClassUserInfo user = new ClassUserInfo();
        ////        user.ID = userinfo.ID;
        ////        user.IP = userinfo.IP;
        ////        user.Port = userinfo.Port;
        ////        user.AssemblyVersion = userinfo.AssemblyVersion;
        ////        this.UpdateUser(user);//更新用户状态

        ////        foreach (ChatListItem item in chatListBox.Items)
        ////        {
        ////            foreach (ChatListSubItem subItem in item.SubItems)
        ////            {
        ////                if (subItem.Tag.ToString().ToLower() == user.ID.ToLower())
        ////                {
        ////                    subItem.Status = ChatListSubItem.UserStatus.Online;
        ////                    break;
        ////                }

        ////            }
        ////        }
        ////        //更改新用户的状态
        ////    }
        ////    // MessageBox.Show("1");

        ////}
        //#endregion

        //#region 操作当前用户的方法
        ////public ClassUserInfo findUser(string ID)//在我的用户列表中查找用户ID
        ////{
        ////    foreach (ClassUserInfo userinfo in this.MyUsers)
        ////        if (userinfo.ID.ToLower() == ID.ToLower())
        ////            return userinfo;
        ////    return null;
        ////}

        /////// <summary>
        /////// 更新用户状态 IP 和端口信息
        /////// </summary>
        /////// <param name="user"></param>
        ////public void UpdateUser(ClassUserInfo user)
        ////{
        ////    //更新用户状态 IP 和端口信息
        ////    foreach (ClassUserInfo userinfo in this.MyUsers)
        ////    {
        ////        if (userinfo.ID.ToLower() == user.ID.ToLower())
        ////        {
        ////            userinfo.State = user.State;
        ////            userinfo.IP = user.IP;
        ////            userinfo.Port = user.Port;
        ////            break;
        ////        }
        ////    }
        ////}

        ////public void RemoveUser(string ID)
        ////{
        ////    foreach (ClassUserInfo userinfo in this.MyUsers)
        ////    {
        ////        if (userinfo.ID.ToLower() == ID.ToLower())
        ////        {
        ////            this.MyUsers.Romove(userinfo);
        ////            break;
        ////        }
        ////    }

        ////}

        //#endregion

        //#region 设置一些用户菜单事件


        //private void skinButton_State_Click(object sender, EventArgs e)
        //{
        //    this.skinContextMenuStrip_State.Show(skinButton_State, new Point(0, skinButton_State.Height), ToolStripDropDownDirection.Right);
        //}

        //private void toolStripMenuItem20_Click(object sender, EventArgs e)
        //{
        //    ToolStripMenuItem Item = (ToolStripMenuItem)sender;
        //    skinButton_State.Image = Item.Image;
        //    skinButton_State.Tag = Item.Tag;
        //    // this.myselfChatListSubItem.Status = (ChatListSubItem.UserStatus)Convert.ToInt32(skinButton_State.Tag);

        //}

        //private void toolStripMenuItem30_Click(object sender, EventArgs e)
        //{
        //    ToolStripMenuItem Item = (ToolStripMenuItem)sender;
        //    skinButton_State.Image = Item.Image;
        //    skinButton_State.Tag = Item.Tag;
        //}

        //private void toolStripMenuItem31_Click(object sender, EventArgs e)
        //{
        //    ToolStripMenuItem Item = (ToolStripMenuItem)sender;
        //    skinButton_State.Image = Item.Image;
        //    skinButton_State.Tag = Item.Tag;
        //}

        //private void toolStripMenuItem32_Click(object sender, EventArgs e)
        //{
        //    ToolStripMenuItem Item = (ToolStripMenuItem)sender;
        //    skinButton_State.Image = Item.Image;
        //    skinButton_State.Tag = Item.Tag;
        //}

        //private void toolStripMenuItem33_Click(object sender, EventArgs e)
        //{
        //    ToolStripMenuItem Item = (ToolStripMenuItem)sender;
        //    skinButton_State.Image = Item.Image;
        //    skinButton_State.Tag = Item.Tag;
        //}

        //#endregion

        #region 双击打开用户列表
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;

            if (item.NicName == "网页用户")
            {
                IMUserInfo friend = new IMUserInfo();
                friend.ID        = item.Tag.ToString();
                friend.NickyName = "网页用户";
                friend.Signature = "网页用户";
                item.IsTwinkle   = false;//不闪烁
                FormManager.Instance.ActivateOrCreateFormSend(item.Tag.ToString(), friend);
            }
            else
            {
                IMUserInfo chatuser = item.Tag as IMUserInfo;
                item.IsTwinkle = false;//不闪烁

                FormManager.Instance.ActivateOrCreateFormSend(chatuser);
            }
        }
 private void selectUserBox_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     if (e.SelectSubItem.Status == ChatListSubItem.UserStatus.OffLine)
     {
         e.SelectSubItem.Status  = ChatListSubItem.UserStatus.Online;
         e.SelectSubItem.NicName = "已选择";
         selectedUserID.Add((int)e.SelectSubItem.ID);
     }
     else if (e.SelectSubItem.Status == ChatListSubItem.UserStatus.Online)
     {
         e.SelectSubItem.Status  = ChatListSubItem.UserStatus.OffLine;
         e.SelectSubItem.NicName = "未选择";
         foreach (int i in selectedUserID)
         {
             if (i == (int)e.SelectSubItem.ID)
             {
                 selectedUserID.Remove(i);
                 break;
             }
         }
     }
 }
Exemple #21
0
 private void groupChatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     userHeadNotTwinkle(e.SelectSubItem.ID, 1);
     if (publicClass.g1 == null)
     {
         publicClass.g1 = new groupChat(e.SelectSubItem.ID, e.SelectSubItem.DisplayName);
         publicClass.g1.Show();
     }
     else if (e.SelectSubItem.ID != publicClass.g1.groupID)
     {
         publicClass.g1.Close();
         publicClass.g1 = new groupChat(e.SelectSubItem.ID, e.SelectSubItem.DisplayName);
         publicClass.g1.Show();
     }
     else
     {
         if (publicClass.g1.IsDisposed)
         {
             publicClass.g1 = new groupChat(e.SelectSubItem.ID, e.SelectSubItem.DisplayName);
             publicClass.g1.Show();
         }
     }
 }
Exemple #22
0
        private UserInformationForm userInformationForm;//悬浮至头像时
        private void chatShow_MouseEnterHead(object sender, ChatListEventArgs e)
        {
            if (userInformationForm == null || userInformationForm.IsDisposed)
            {
                userInformationForm = new UserInformationForm();
            }
            int top  = this.Top + this.ChatTab.Top + this.ChatTab.ItemSize.Height + (e.MouseOnSubItem.HeadRect.Y - this.chatListBox.chatVScroll.Value);
            int left = this.Left - 279 - 5;
            int ph   = Screen.GetWorkingArea(this).Height;

            if (top + 181 > ph)
            {
                top = ph - 181 - 5;
            }

            if (left < 0)
            {
                left = this.Right + 5;
            }
            userInformationForm.IsFMove   = false;
            this.userInformationForm.Item = e.MouseOnSubItem;
            this.userInformationForm.SetUserData(e.MouseOnSubItem, new Point(left, top));
            this.userInformationForm.Show();
        }
Exemple #23
0
        private void ChatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
        {
            if (es.Button != MouseButtons.Left)
            {
                return;
            }
            var itemId = (long)e.SelectSubItem.ID;

            if (Class1.chatListSubItemPool.ContainsKey(itemId) && Class1.chatListSubItemPool[itemId] == e.SelectSubItem)
            {
                var      userId = itemId;
                frm_chat frm_chat;
                if (Class1.formChatPool.ContainsKey(userId))
                {
                    frm_chat = Class1.formChatPool[userId];
                    frm_chat.Activate();
                }
                else
                {
                    frm_chat = new frm_chat(userId);
                    Class1.formChatPool.Add(userId, frm_chat);
                    frm_chat.Show();
                }
                if (Class1.unReadPrivateMsgItemPool.ContainsKey(userId))
                {
                    var updateFriendLastReadMsgIdReq = new http._User_Relation.UpdateFriendLastReadMsgIdReq()
                    {
                        UserId        = Class1.UserId,
                        LastReadMsgId = new Dictionary <long, long>()
                    };
                    var subItem = Class1.unReadPrivateMsgItemPool[userId];
                    var ids     = ((List <long>)(((Dictionary <string, object>)subItem.Tag)["ids"]));
                    foreach (var id in ids)
                    {
                        if (updateFriendLastReadMsgIdReq.LastReadMsgId.ContainsKey(userId))
                        {
                            updateFriendLastReadMsgIdReq.LastReadMsgId[userId] = Math.Max(updateFriendLastReadMsgIdReq.LastReadMsgId[userId], id);
                        }
                        else
                        {
                            updateFriendLastReadMsgIdReq.LastReadMsgId.Add(userId, id);
                        }
                    }
                    http._User_Relation.UpdateFriendLastReadMsgId(updateFriendLastReadMsgIdReq);

                    Class1.frmMsgBox.clb_unread_msg.Items[0].SubItems.Remove(subItem);
                    Class1.unReadPrivateMsgItemPool.Remove(userId);
                    icon.ChangeIconState();
                }
            }
            else if (Class1.groupItemPool.ContainsKey(itemId) && Class1.groupItemPool[itemId] == e.SelectSubItem)
            {
                var       groupId = itemId;
                frm_group frmGroup;
                if (Class1.formGroupPool.ContainsKey(groupId))
                {
                    frmGroup = Class1.formGroupPool[groupId];
                    frmGroup.Activate();
                }
                else
                {
                    frmGroup = new frm_group(Class1.GetGroupInfo(groupId));
                    Class1.formGroupPool.Add(groupId, frmGroup);
                    frmGroup.Show();
                }
                if (Class1.unReadGroupMsgItemPool.ContainsKey(groupId))
                {
                    var subItem = Class1.unReadGroupMsgItemPool[groupId];
                    var maxId   = (long)((Dictionary <string, object>)subItem.Tag)["max_id"];
                    var req     = new http._Group_User.UpdateGroupLastReadMsgIdReq()
                    {
                        UserId        = Class1.UserId,
                        LastReadMsgId = new Dictionary <long, long>()
                        {
                            { groupId, maxId }
                        }
                    };
                    http._Group_User.UpdateGroupLastReadMsgId(req);

                    Class1.frmMsgBox.clb_unread_msg.Items[2].SubItems.Remove(subItem);
                    Class1.unReadGroupMsgItemPool.Remove(groupId);
                    icon.ChangeIconState();
                }
            }
        }
Exemple #24
0
 private void ColleagePanel_DoubleClickSubItem(object sender, ChatListEventArgs e)
 {
 }
Exemple #25
0
        private void chatListBox2_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            QQTalk qqtalk = new QQTalk();

            qqtalk.Show();
        }
Exemple #26
0
 private void chatListBox1_DoubleClickSubItem(object sender, ChatListEventArgs e)
 {
     MessageBox.Show(e.SelectSubItem.DisplayName);
 }
 //离开头像时
 private void chatShow_MouseLeaveHead(object sender, ChatListEventArgs e)
 {
     Thread.Sleep(100);
     if (frm != null && !frm.Bounds.Contains(Cursor.Position))
     {
         frm.Hide();
     }
 }
 private void chatShow_MouseEnterHead(object sender, ChatListEventArgs e)
 {
     //窗体的TopLeft值
     int UserTop = this.Top + this.chatShow.Top + (e.MouseOnSubItem.HeadRect.Y - chatShow.chatVScroll.Value);
     int UserLeft = this.Left - 279 - 5;
     //屏幕不包括任务栏的高度
     int PH = Screen.GetWorkingArea(this).Height;
     //判断是否超过屏幕高度
     if (UserTop + 181 > PH)
     {
         UserTop = PH - 181 - 5;
     }
     //判断是否小于屏幕左边
     if (UserLeft < 0)
     {
         UserLeft = this.Right + 5;
     }
     //窗体不为空传值
     if (frm != null)
     {
         frm.Item = e.MouseOnSubItem;
         frm.Location = new Point(UserLeft, UserTop);
         frm.Show();
     }
     else  //窗体为空New一个
     {
         frm = new FrmUserInformation(e.MouseOnSubItem, new Point(UserLeft, UserTop));
         frm.Show();
     }
 }
Exemple #29
0
        private void chatListBox_group_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            ChatListSubItem item = e.SelectSubItem;
            IGroup group = (IGroup)item.Tag;
            item.IsTwinkle = false;

            if (this.GroupDoubleClicked != null)
            {
                this.GroupDoubleClicked(group);
            }
        }
Exemple #30
0
 private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     ChatListSubItem item = e.SelectSubItem;//获取选中的好友
     item.IsTwinkle = false; //取消头像闪烁状态
     string windowsName = item.NicName + ' ' + item.ID;//聊天窗口的标题
     IntPtr handle = NativeMethods.FindWindow(null, windowsName);//查找是否已经存在窗口
     if (handle != IntPtr.Zero)//窗口已存在
     {
         Form frm = (Form)Form.FromHandle(handle);
         frm.Activate();//激活
     }
     else//窗口不存在
     {
         Form_Chat fChat = new Form_Chat(this.rapidPassiveEngine,item,this.myInfo,this);
         fChat.Text =item.NicName+' '+item.ID;
         fChat.Show();
     }
 }
        private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            Parameter<string, bool> para = RecentListBox.ParseIDFromRecentID(e.SelectSubItem.ID);

            if (this.UnitDoubleClicked != null)
            {
                this.UnitDoubleClicked(para.Arg1, para.Arg2);
            }
        }
Exemple #32
0
 void chatListBox1_ContextSubItem(object sender, ChatListEventArgs e)
 {
     _IsOpen = true;
     contextMenuStrip1.Show();
     _IsOpen = false;
 }
Exemple #33
0
 private void chatListBox1_MouseLeaveHead(object sender, ChatListEventArgs e)
 {
     this.Text = "Null";
 }
Exemple #34
0
        private void GroupListBox_DoubleClickSubItem(object sender, ChatListEventArgs e)
        {
            GroupChatForm form = new GroupChatForm(e.SelectSubItem);

            form.Show();
        }
Exemple #35
0
 private void chatListBox1_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     MessageBox.Show(e.SelectSubItem.NicName);
 }
Exemple #36
0
 //隐藏基本信息
 private void friendsList_MouseLeaveHead(object sender, ChatListEventArgs e)
 {
     userInformationForm.Hide();
 }
Exemple #37
0
 private void chatListBox1_MouseEnterHead(object sender, ChatListEventArgs e)
 {
     this.Text = e.MouseOnSubItem.DisplayName;
 }
Exemple #38
0
 private void listbox_clients_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
 }
Exemple #39
0
 /// <summary>
 /// 重点对象朋友列表 右键菜单.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void MajorFriendList_ContextSubItem(object sender, ChatListEventArgs e)
 {
     _MarjorRightSubItem = e.SelectSubItem;
     contextMajorFriend.Show(Cursor.Position);
 }