Esempio n. 1
0
 public void AddChattingSubItemInDistoryPanel(ChatintSubItem item)
 {
     this.flowLayoutPanelofDisChatting.Controls.Add(item);
     this.flowLayoutPanelofDisChatting.Height = this.flowLayoutPanelofDisChatting.Height + item.Height + 20;
     //Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     //flowLayoutPanelofDisChattingflowLayoutPanel1.AutoScrollPosition = newPoint;
 }
Esempio n. 2
0
 public void AddChattingSubItemInDistoryPanel(ChatintSubItem item)
 {
     this.flowLayoutPanelofDisChatting.Controls.Add(item);
     this.flowLayoutPanelofDisChatting.Height = this.flowLayoutPanelofDisChatting.Height + item.Height + 20;
     //Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     //flowLayoutPanelofDisChattingflowLayoutPanel1.AutoScrollPosition = newPoint;
 }
Esempio n. 3
0
 public void AddChattingSubItem(ChatintSubItem item)
 {
     this.flowLayoutPanelOfChattingNow.Controls.Add(item);
     this.flowLayoutPanelOfChattingNow.Height = this.flowLayoutPanelOfChattingNow.Height + item.Height+20;
     Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     flowLayoutPanel1.AutoScrollPosition = newPoint;
 }
Esempio n. 4
0
        public void AddChattingSubItem(ChatintSubItem item)
        {
            this.flowLayoutPanelOfChattingNow.Controls.Add(item);
            this.flowLayoutPanelOfChattingNow.Height = this.flowLayoutPanelOfChattingNow.Height + item.Height + 20;
            Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);

            flowLayoutPanel1.AutoScrollPosition = newPoint;
        }
Esempio n. 5
0
        private void createChatPanel(string chatContent,long userId,DateTime dt)
        {
            ChattingTimePanel time = new ChattingTimePanel();
            time.TimeString = dt.ToString("yyyy-MM-dd HH:mm");
            this.chattingPanel1.AddChattingTimePanel(time);

            ChatintSubItem chatsubitem = new ChatintSubItem();
            chatsubitem.Message = chatContent;
            chatsubitem.HeaderId = int.Parse(userId.ToString());
            if (userId == sendUser.Id)
            {
                chatsubitem.IsSayIngIsMe = true;
            }
            else
            {
                chatsubitem.IsSayIngIsMe = false;
            }
            this.chattingPanel1.AddChattingSubItem(chatsubitem);
        }
Esempio n. 6
0
        private void chattingPanel1_SeemoreLabelClicked(object sender, EventArgs e)
        {
            //this.linkLabel2.Cursor = Cursors.WaitCursor;
            try
            {
                KjqbService.ChatInService[] chat;

                chat = ser.SearchChatHistory((int)sendUser.Id, (int)receiveUser.Id, serviceTime);
                for (int i = 0; i < chat.Length; i++)
                {
                    if (chat[i].ReceiveUserId == sendUser.Id)
                    {
                        ChatintSubItem subitem = new ChatintSubItem();
                        subitem.HeaderId = int.Parse(receiveUser.Id.ToString());
                        subitem.Message = chat[i].ChatContent;
                        subitem.IsSayIngIsMe = false;

                        ChattingTimePanel time = new ChattingTimePanel();
                        time.TimeString = chat[i].TimeStamp.ToString("yyyy-MM-dd HH:mm");

                        this.chattingPanel1.AddChattingSubItemInDistoryPanel(subitem);

                        this.chattingPanel1.AddChattingTimePanelInDistoryPanel(time);
                        //createChatPanelOfflowlayout2(chat[i].ChatContent, receiveUser.KuName, chat[i].TimeStamp);
                    }
                    else if (chat[i].ReceiveUserId == receiveUser.Id)
                    {
                        ChatintSubItem subitem = new ChatintSubItem();
                        subitem.HeaderId = int.Parse(sendUser.Id.ToString());
                        subitem.Message = chat[i].ChatContent;
                        subitem.IsSayIngIsMe = true;

                        ChattingTimePanel time = new ChattingTimePanel();
                        time.TimeString = chat[i].TimeStamp.ToString("yyyy-MM-dd HH:mm");

                        this.chattingPanel1.AddChattingSubItemInDistoryPanel(subitem);

                        this.chattingPanel1.AddChattingTimePanelInDistoryPanel(time);

                        //createChatPanelOfflowlayout2(chat[i].ChatContent, sendUser.KuName, chat[i].TimeStamp);
                    }
                }

                serviceTime = chat[chat.Length - 1].TimeStamp;

                if (chat.Length > 0)
                {
                    //Point newPoint = new Point(0, 0);
                    //flowLayoutPanel1.AutoScrollPosition = newPoint;
                }
                else
                {
                this.chattingPanel1.SetSeeMoreLabelText("没有了…");
                }
            }
            catch { }

            //this.linkLabel2.Cursor = Cursors.Hand;
        }