Example #1
0
        ///// <summary>
        ///// 创建聊天对象
        ///// </summary>
        ///// <param name="request"></param>
        ///// <param name="isCreate"></param>
        //public void CreateChatItems(AddChatRequest request, bool fromReceieveMessage)
        //{
        //    this.Text = GlobalVariable.LoginUserInfo.DisplayName + " 的聊天窗口";
        //    IsHide = false;
        //    ReflashTeamChat();
        //    ChatItem chatItem = GetItemInChatListBox(request.UserName);
        //    if (chatItem == null)
        //    {
        //        chatItem = ChatNav.CreateItem(request);

        //    }

        //    if (fromReceieveMessage)
        //    {
        //        if (!string.IsNullOrWhiteSpace(selectUserName) && chatItem.UserName != selectUserName)
        //        {
        //            //chatItem.Caption = chatItem.DisplayName + " 有新消息!";
        //            chatItem.SmallImage = Resource1.新消息24;
        //        }
        //        else
        //        {
        //            ChatItemSelected(chatItem, false);
        //        }
        //    }
        //    else
        //    {
        //        ChatItemSelected(chatItem, false);
        //    }
        //}

        public void CreateChatItems(ChatMessage request, bool fromReceieveMessage)
        {
            this.Text = GlobalVariable.LoginUserInfo.DisplayName + " 的聊天窗口";
            IsHide    = false;
            ReflashTeamChat();
            ChatItem chatItem = GetItemInChatListBox(request.SendUserName);

            if (chatItem == null)
            {
                chatItem = ChatNav.CreateItem(request);
            }

            if (fromReceieveMessage)
            {
                if (!string.IsNullOrWhiteSpace(selectUserName) && chatItem.UserName != selectUserName)
                {
                    //chatItem.Caption = chatItem.DisplayName + " 有新消息!";
                    chatItem.SmallImage = Resource1.新消息24;
                }
                else
                {
                    ChatItemSelected(chatItem, false);
                }
            }
            else
            {
                ChatItemSelected(chatItem, false);
            }
        }
Example #2
0
 public void ChangeAllowChat(ChatType chatType, bool allow)
 {
     ChatNav.SetAllowOrFobbitChat(chatType, allow);
     //switch (chatType)
     //{
     //    case ChatType.PrivateChat:
     //        if (allow)
     //        {
     //            ChatNav.Groups[2].LargeImage = Resource1.私;
     //        }
     //        else
     //        {
     //            ChatNav.Groups[2].LargeImage = Resource1.禁止;
     //        }
     //        break;
     //    case ChatType.GroupChat:
     //        break;
     //    case ChatType.TeamChat:
     //        if (allow)
     //        {
     //            ChatNav.Groups[1].LargeImage = Resource1.群组;
     //        }
     //        else
     //        {
     //            ChatNav.Groups[1].LargeImage = Resource1.禁止;
     //        }
     //        break;
     //    default:
     //        break;
     //}
 }
Example #3
0
 public ChatForm()
 {
     InitializeComponent();
     labChatTitle.Text       = "";
     ChatNav.SelectChatItem += ChatNav_SelectChatItem;
     ChatNav.CreateALLGroupChat(groupId);
     InitProgressBar();
 }
Example #4
0
        public ChatForm()
        {
            InitializeComponent();
            var groupChat = GlobalVariable.CreateGroupChat(groupId);

            if (groupChat != null)
            {
                ChatNav.CreateItem(groupChat);
            }
            InitProgressBar();
        }
Example #5
0
 /// <summary>
 /// 刷新群组信息
 /// </summary>
 public void ReflashTeamChat()
 {
     if (GlobalVariable.IsTeamChatChanged)
     {
         GlobalVariable.IsTeamChatChanged = false;
         var list = GlobalVariable.GetTeamChatList();
         ChatNav.Groups[1].ItemLinks.Clear();
         foreach (ChatStore item in list)
         {
             ChatNav.CreateItem(item);
         }
     }
 }
Example #6
0
        /// <summary>
        /// 群组列表右键菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChatNav_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                NavBarHitInfo hit = ChatNav.CalcHitInfo(e.Location);

                if ((!hit.InLink))
                {
                    return;
                }

                if (hit.Group.Name != "navBarGroup2")
                {
                    return;
                }

                Point p = new Point(e.Location.X, e.Location.Y + ChatNav.Appearance.Item.FontHeight);
                popupMenu1.ShowPopup(ChatNav.PointToScreen(p));
            }
        }
Example #7
0
 /// <summary>
 /// 聊天列表对象被选中
 /// </summary>
 /// <param name="chatItem"></param>
 private void ChatItemSelected(ChatItem chatItem)
 {
     ChatNav.SetSelectChatItem(chatItem, false);
 }
Example #8
0
        ///// <summary>
        ///// 创建聊天对象
        ///// </summary>
        ///// <param name="request"></param>
        ///// <param name="isCreate"></param>
        //public void CreateChatItems(AddChatRequest request, bool fromReceieveMessage)
        //{
        //    this.Text = GlobalVariable.LoginUserInfo.DisplayName + " 的聊天窗口";
        //    IsHide = false;
        //    ReflashTeamChat();
        //    ChatItem chatItem = GetItemInChatListBox(request.UserName);
        //    if (chatItem == null)
        //    {
        //        chatItem = ChatNav.CreateItem(request);

        //    }

        //    if (fromReceieveMessage)
        //    {
        //        if (!string.IsNullOrWhiteSpace(selectUserName) && chatItem.UserName != selectUserName)
        //        {
        //            //chatItem.Caption = chatItem.DisplayName + " 有新消息!";
        //            chatItem.SmallImage = Resource1.新消息24;
        //        }
        //        else
        //        {
        //            ChatItemSelected(chatItem, false);
        //        }
        //    }
        //    else
        //    {
        //        ChatItemSelected(chatItem, false);
        //    }
        //}


        public void ReflashTeamChat()
        {
            ChatNav.ReflashTeamChat();
        }