📄 conversationwindow.cs
字号:
}
private void contact_RelationStatusChanged(object sender, EventArgs e)
{
try
{
if (!this.IsMultiConversation)
{
this.InitContactInfo(sender as Imps.Client.Core.Contact);
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void contact_TypeChanged(object sender, ContactTypeChangedEventArgs ev)
{
try
{
if (this.IsMultiConversation)
{
this.AddContactEvent(ev.NewContactInstance);
for (int i = 0; i < this.menuBlockUsers.get_Items().get_Count(); i++)
{
if (this.menuBlockUsers.get_Items().get_Item(i).get_Tag() == sender)
{
this.menuBlockUsers.get_Items().Remove(this.menuBlockUsers.get_Items().get_Item(i));
break;
}
}
for (int j = 0; j < this.tsOperationBlock.get_DropDownItems().get_Count(); j++)
{
if (this.tsOperationBlock.get_DropDownItems().get_Item(j).get_Tag() == sender)
{
this.tsOperationBlock.get_DropDownItems().Remove(this.tsOperationBlock.get_DropDownItems().get_Item(j));
break;
}
}
this.menuBlockUsers.get_Items().Add(this.GetBlockMenuItem(ev.NewContactInstance));
this.tsOperationBlock.get_DropDownItems().Add(this.GetBlockMenuItem(ev.NewContactInstance));
this.InitTooltipInfo();
}
else
{
this.InitContactInfo(ev.NewContactInstance);
if ((this.CurrentConversation != null) && (this.CurrentConversation.CurrentDialog != null))
{
this.CurrentConversation.Close();
}
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
finally
{
ev.AutoResetEvent.Set();
}
}
private void controlButton_CollapseExpand(object sender, EventArgs e)
{
try
{
this.CurrentUser.Configuration.UserSetting.ConversationSetting.ShowPortrait = !this.isExpanded;
if (this.isExpanded)
{
this.pnlRight.Width = 0;
this.scMain.Width = this.pnlTop.Width;
}
else
{
this.pnlRight.Width = this.pnlRightWidth;
this.scMain.Width = (this.pnlTop.Width - this.pnlRight.Width) - 6;
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void ConversationSetting_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
if (!base.IsDisposed && e.ContainsProperty("EnterToSend"))
{
if (this.CurrentUser.Configuration.UserSetting.ConversationSetting.SendMessageByEnterKey != null)
{
this.tsSendCtrlEnter.set_Checked(false);
this.tsSendEnter.set_Checked(true);
}
else
{
this.tsSendCtrlEnter.set_Checked(true);
this.tsSendEnter.set_Checked(false);
}
}
}
private void ConversationWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.Alt && (e.KeyCode == Keys.S))
{
e.set_SuppressKeyPress(true);
this.SendMessage();
}
else if (e.KeyCode == Keys.F6)
{
if (this.tsInvite.get_Enabled())
{
this.tsInvite_Click(null, null);
}
}
else if (e.KeyCode == Keys.F7)
{
if (this.tsIVR.get_Enabled())
{
this.tsIVR_Click(null, null);
}
}
else if ((e.KeyCode == Keys.F8) || (e.Control && (e.KeyCode == Keys.M)))
{
if (this.tsSendSMS.get_Enabled())
{
this.tsSendSMS_Click(null, null);
}
}
else if ((e.Control && e.Alt) && (e.KeyCode == Keys.Space))
{
this._manager.ShowFileType = true;
ImpsEmoticons.Instance.ResetEmotions();
}
else
{
this._historyChatManager.SendKeys(e.KeyCode, e.Modifiers);
}
}
private void ConversationWindow_Resize(object sender, EventArgs e)
{
}
private void ConversationWindow_ResizeEnd(object sender, EventArgs e)
{
}
private static string ConvertString(string source)
{
return StringHelper.EncodString(source);
}
private void CurrentUser_StatusChanged(object sender, UserSatusChangedEventArgs e)
{
if (!base.IsDisposed)
{
try
{
if (e.NewStatus == UserAccountStatus.Logon)
{
this.DoUserLogon();
}
else if (e.OldStatus == UserAccountStatus.Logon)
{
this.DoUserNotLogon();
}
this.InitTooltipInfo();
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
}
private void de_DisplayEmoticonsHide(object sender, EventArgs e)
{
this.tsbEmoticons.set_Checked(false);
}
private void diallg_SendMessageFailed(object sender, MessageSendFailedEventArgs e)
{
this.AppendSendMessageError(e.Message.Content, e.Error);
}
private void dialog_AddParticipant(object sender, ParticipantEventArgs e)
{
try
{
Dialog dialog = sender as Dialog;
Imps.Client.Core.Contact contact = e.Participant.Contact;
if (dialog.IsMulitiConversation)
{
using (IEnumerator<ConversationParticipant> enumerator = this.CurrentConversation.CurrentDialog.Participants.GetEnumerator())
{
while (enumerator.MoveNext())
{
ConversationParticipant participant = enumerator.get_Current();
this.AddParticipant(participant.Contact);
}
return;
}
}
this.InitContactInfo(contact);
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("多人会话添加联系人失败!", exception.ToString());
}
}
private void dialog_AddShareContent(object sender, ShareContentEventArgs e)
{
try
{
if (!e.ShareContent.IsCancel && !e.ShareContent.IsClosed)
{
ShareContent sc = e.ShareContent;
sc.ShareContentCancel += new EventHandler(this.sc_ShareContentCancel);
sc.ShareContentComplete += new EventHandler(this.sc_ShareContentComplete);
sc.ShareContentFailed += new EventHandler<ShareContentFailedEventArgs>(this, (IntPtr) this.sc_ShareContentFailed);
sc.ShareContentProgress += new EventHandler<ShareContentProcessEventArgs>(this, (IntPtr) this.sc_ShareContentProgress);
sc.Closed += new EventHandler(this.sc_Closed);
this.BuildShareContent(sc);
if (!this.BeActivated)
{
ControlHelper.FlashWindow(this);
}
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void dialog_Closed(object sender, EventArgs e)
{
try
{
Dialog dialog = sender as Dialog;
dialog.MessageRecieved -= new EventHandler<MessageEventArgs>(this, (IntPtr) this.dialog_MessageRecieved);
dialog.SendMessageFailed -= new EventHandler<MessageSendFailedEventArgs>(this, (IntPtr) this.diallg_SendMessageFailed);
dialog.Closed -= new EventHandler(this.dialog_Closed);
dialog.AddParticipant -= new EventHandler<ParticipantEventArgs>(this, (IntPtr) this.dialog_AddParticipant);
dialog.RemoveParticipant -= new EventHandler<ParticipantEventArgs>(this, (IntPtr) this.dialog_RemoveParticipant);
dialog.AddShareContent -= new EventHandler<ShareContentEventArgs>(this, (IntPtr) this.dialog_AddShareContent);
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void dialog_MessageRecieved(object sender, MessageEventArgs e)
{
try
{
this.AppendMessage(e.Message);
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void dialog_ReceiveNudgeRequest(object sender, ParticipantEventArgs e)
{
try
{
this.AppendNudgeMessage(string.Format(StringTable.Conversation.MsgNudgeReceive, e.Participant.Contact.DisplayName));
if (!this.BeActivated)
{
ControlHelper.FlashWindow(this);
}
if (base.WindowState != FormWindowState.Minimized)
{
this.NudgeWindow();
}
else
{
this.PlayNudgeSound();
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void dialog_RemoveParticipant(object sender, ParticipantEventArgs e)
{
Dialog dialog = sender as Dialog;
if ((this.Curren
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -