///// <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); } }
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; //} }
public ChatForm() { InitializeComponent(); labChatTitle.Text = ""; ChatNav.SelectChatItem += ChatNav_SelectChatItem; ChatNav.CreateALLGroupChat(groupId); InitProgressBar(); }
public ChatForm() { InitializeComponent(); var groupChat = GlobalVariable.CreateGroupChat(groupId); if (groupChat != null) { ChatNav.CreateItem(groupChat); } InitProgressBar(); }
/// <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); } } }
/// <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)); } }
/// <summary> /// 聊天列表对象被选中 /// </summary> /// <param name="chatItem"></param> private void ChatItemSelected(ChatItem chatItem) { ChatNav.SetSelectChatItem(chatItem, false); }
///// <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(); }