Пример #1
0
        private void ReceievePrivateMessage(PrivateChatRequest message)
        {
            var request = message.ToChatMessage();

            GlobalVariable.AddNewChat(request);
            OpenOrCreateChatForm(request, true);
        }
Пример #2
0
        //private void OpenChatForm(AddChatRequest request)
        //{
        //    GlobalVariable.AddNewChat(request);
        //    chatForm.BringToFront();
        //    chatForm.Show();
        //    chatForm.CreateChatItems(request, true);
        //}

        private void OpenChatForm(ChatMessage message)
        {
            GlobalVariable.AddNewChat(message);
            chatForm.BringToFront();
            chatForm.Show();
            chatForm.CreateChatItems(message, true);
        }
Пример #3
0
        private void menuGroupChat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var request = new ChatMessage();

            request.SendDisplayName = "所有人";
            request.ChatType        = ChatType.PrivateChat;
            request.SendUserName    = "******";
            request.UserType        = ClientRole.Student;
            GlobalVariable.AddNewChat(request);
            OpenOrCreateChatForm(request, false);
        }
Пример #4
0
        private void ChatToALL()
        {
            var request = new ChatMessage();

            request.SendDisplayName = "所有人";
            request.ChatType        = ChatType.GroupChat;
            request.SendUserName    = "******";
            request.UserType        = ClientRole.Student;
            GlobalVariable.AddNewChat(request);
            OpenOrCreateChatForm(request, false);
        }
Пример #5
0
        /// <summary>
        /// 私聊
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void userList_privateChat_Click(object sender, EventArgs e)
        {
            string         userName    = this.onlineList.SelectedItems[0].SubItems[2].Text;
            string         displayName = this.onlineList.SelectedItems[0].Text;
            AddChatRequest request     = new AddChatRequest();

            request.DisplayName = displayName;
            request.ChatType    = ChatType.PrivateChat;
            request.UserName    = userName;
            request.UserType    = ClientRole.Student;
            GlobalVariable.AddNewChat(request);
            OpenOrCreateChatForm(request, false);
        }
Пример #6
0
        /// <summary>
        /// 接收到私聊信息
        /// </summary>
        /// <param name="privateChatResponse"></param>
        private void AppendToPrivateForm(PrivateChatRequest privateChatResponse)
        {
            AddChatRequest request = privateChatResponse.ToAddChatRequest();

            GlobalVariable.AddNewChat(request);
            if (CheckChatFormIsOpen())
            {
                //   chatForm.DoReveieveMessage(request);
                OpenOrCreateChatForm(request, true);
            }
            else
            {
                OpenOrCreateChatForm(request, true);
                // ShowNotify(request);
            }
        }
Пример #7
0
        /// <summary>
        /// 用户列表右键操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UserListMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string name = e.ClickedItem.Name;

            GetSelectStudentUserName();
            if (string.IsNullOrWhiteSpace(actionStuUserName))
            {
                return;
            }
            //  GlobalVariable.ShowSuccess(actionStuUserName);
            switch (name)
            {
            case "userList_privateChat":
                // string userName = lvOnline.SelectedItems[0].SubItems[2].Text;
                string displayName = onlineListGrid1.SelectedRows[0].Cells["col_name"].Value.ToString();
                var    request     = new ChatMessage();
                request.SendDisplayName = displayName;
                request.ChatType        = ChatType.PrivateChat;
                request.SendUserName    = actionStuUserName;
                request.UserType        = ClientRole.Student;
                GlobalVariable.AddNewChat(request);
                OpenOrCreateChatForm(request, false);

                break;

            case "userList_lockScreen":

                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    GlobalVariable.client.Send_LockScreen(actionStuUserName);
                }
                break;

            case "userList_stopLockScreen":

                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    GlobalVariable.client.Send_StopLockScreen(actionStuUserName);
                }
                break;

            case "userList_studentShow":

                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    GlobalVariable.client.Send_CallStudentShow(actionStuUserName);
                }
                break;

            case "userList_studentVideoShow":

                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    GlobalVariable.client.Send_CallStudentShowVideoForMySelf(actionStuUserName);
                }
                break;

            case "userList_stopStudentShow":
                StopPlay();

                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    HideScreenShowPic(actionStuUserName);
                    GlobalVariable.client.Send_StopStudentShow(actionStuUserName);
                }
                break;

            default:
                break;
            }
        }