/// <summary> /// 发送消息 /// </summary> private void SendMsg() { if (!Util_Buddy.IsOnlineStatus()) { Util_Misc.NotifyMsgToConversation(this.CurrentIMSession.Buddy.Uin, false, CoreMessenger.Instance.MiscHelper.TXLoadString("CF_SELF_OFFLINE")); } else if (this.InputBox.Text.Length > 0x1194) { Util_Misc.NotifyMsgToConversation(this.CurrentIMSession.Buddy.Uin, false, CoreMessenger.Instance.MiscHelper.TXLoadString("CF_EDITMSG_LARGE_MESSAGE")); } else { MessagePack messagePack = CreateMessagePack(); if ((messagePack != null) && (this.CurrentIMSession != null)) { this.CurrentIMSession.SendMessage(messagePack); Buddy currentBuddy = Util_Buddy.GetCurrentBuddy(); this.CurrentIMSession.AddMsg(currentBuddy, TimeConverter.Now, messagePack); try { this.InputBox.Text = ""; } catch (Exception) { } } } }
private void OnItemDoubleClicked(object sender, RoutedEventArgs e) { CommunityMember member = this.MemberListBox.ItemContainerGenerator.ItemFromContainer((DependencyObject)sender) as CommunityMember; if ((member != null) && Util_Buddy.IsOnlineStatus()) { Buddy buddy = member.Buddy; if ((buddy != null) && Util_Buddy.IsFriend(buddy.Uin)) { Util_Buddy.OpenContactSessionWindow(buddy); e.Handled = true; } } }