📄 conversationwindow.cs
字号:
if (this.tsSendFile.get_Enabled())
{
foreach (string text in e.Files)
{
this.SendFile(text);
}
}
}
else if (e.EventType == ChatEditDropType.Contact)
{
this.TryAddContact(e.Contact);
}
base.Activate();
}
catch (Exception exception)
{
this.HandleException(exception);
}
return 1;
}
private void _inputChatManager_KeyDown(object sender, KeyEventArgs e)
{
if (((this.tsSendEnter.get_Checked() && (e.KeyCode == Keys.Return)) && !e.Control) || ((this.tsSendCtrlEnter.get_Checked() && e.Control) && (e.KeyCode == Keys.Return)))
{
e.set_SuppressKeyPress(true);
this.SendMessage();
}
if ((e.Alt && (e.KeyCode == Keys.P)) && this.tsCaptureScreen.get_Enabled())
{
this.tsCaptureScreen_ButtonClick(null, EventArgs.Empty);
}
if (e.Alt && (e.KeyCode == Keys.N))
{
this.SendNudge();
}
if (e.Control)
{
if (e.KeyCode == Keys.V)
{
if (Clipboard.ContainsFileDropList() && this.tsSendFile.get_Enabled())
{
object data = Clipboard.GetData(DataFormats.FileDrop);
if (data != null)
{
if (((this.CurrentConversation != null) && (this.CurrentConversation.CurrentDialog != null)) && ((this.CurrentConversation.CurrentDialog.ShareContents.Count + (data as string[]).Length) > 5))
{
this._manager.FrameworkWnd.UnifiedMessageBox.ShowInfo(this, string.Format(StringTable.Conversation.MsgMaxSendShareContentCount, this.CurrentUser.Configuration.SystemSetting.FileShareSetting.MaxShareContentCountOnOneDialog));
}
else
{
foreach (string text in data as string[])
{
this.SendFile(text);
}
e.Handled = true;
}
}
}
}
else if (((e.KeyCode == Keys.E) || (e.KeyCode == Keys.R)) || (e.KeyCode == Keys.L))
{
e.Handled = true;
}
else if (e.KeyCode == Keys.F)
{
this.SendFile();
}
else if (e.KeyCode == Keys.H)
{
this.ShowMessageHistory();
}
}
}
private int _inputChatManager_LinkClick(object sender, ChatEditClickEventArgs e)
{
try
{
if (e.EventType == ChatEditEventType.Link)
{
this.ExecuteFile(e.Text);
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
return 1;
}
private void _lstContacts_MouseClick(object sender, MouseEventArgs e)
{
try
{
if (e.Button == MouseButtons.Left)
{
Imps.Client.Core.Contact listSelectedContact = this.GetListSelectedContact();
if (listSelectedContact != null)
{
this.ShowContactInfo(listSelectedContact.Uri.Raw);
}
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void _op_ImpsError(object sender, ImpsErrorEventArgs e)
{
if (!e.Handled)
{
e.Handled = true;
}
}
private void _smsOperation_ImpsError(object sender, ImpsErrorEventArgs e)
{
e.Handled = true;
this.AppendSendMessageError((sender as AsyncBizOperation).ContextForBiz.ToString(), e.Summary);
}
private void AddContactEvent(Imps.Client.Core.Contact contact)
{
if (!this._hasEventContacts.Contains(contact))
{
this._hasEventContacts.Add(contact);
contact.RelationStatusChanged += new EventHandler(this.contact_RelationStatusChanged);
contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contact_PersonalInfo_PropertiesChanged);
contact.Presence.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contact_Presence_PropertiesChanged);
contact.TypeChanged += new EventHandler<ContactTypeChangedEventArgs>(this, (IntPtr) this.contact_TypeChanged);
contact.IsBlockChanged += new EventHandler<BlockEventArgs>(this, (IntPtr) this.contact_IsBlockChanged);
}
}
private void AddContacts(List<Imps.Client.Core.Contact> list)
{
if ((this.CurrentConversation != null) && (this.CurrentConversation.CurrentDialog != null))
{
lock (this.CurrentConversation.CurrentDialog.Participants)
{
using (IEnumerator<ConversationParticipant> enumerator = this.CurrentConversation.CurrentDialog.Participants.GetEnumerator())
{
while (enumerator.MoveNext())
{
ConversationParticipant participant = enumerator.get_Current();
if (list.Contains(participant.Contact))
{
list.Remove(participant.Contact);
}
}
}
}
}
if (list.get_Count() != 0)
{
if ((this.CurrentConversation != null) && (this.CurrentConversation.CurrentDialog != null))
{
this.CurrentConversation.CurrentDialog.AsyncInviteParticipants(list);
}
else
{
Imps.Client.Core.Contact contact = this.CurrentUser.ContactList.Contacts.FindContact(this.Uri);
if (contact != null)
{
list.Add(contact);
}
this.CurrentConversation = this.CurrentUser.ConversationManager.OpenConversation(null, list);
}
}
}
private void AddDialogEvents(Dialog dialog)
{
try
{
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);
dialog.ReceiveNudgeRequest += new EventHandler<ParticipantEventArgs>(this, (IntPtr) this.dialog_ReceiveNudgeRequest);
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void AddGlobalEvent()
{
this.CurrentUser.StatusChanged += new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this.CurrentUser_StatusChanged);
this.CurrentUser.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.UserInfoPropertiesChange);
this.CurrentUser.Presence.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.UserPresencePropertiesChanged);
this.CurrentUser.Configuration.UserSetting.ConversationSetting.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.ConversationSetting_PropertiesChanged);
this._op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this._op_ImpsError);
this.CurrentUser.ScoreInfo.NewScoreDataArrive += new EventHandler(this.ScoreInfo_NewScoreDataArrive);
}
private void AddParticipant(Imps.Client.Core.Contact contact)
{
if (this.CurrentConversation.CurrentDialog.Participants.Count == 1)
{
this.InitContactInfo(contact);
}
else
{
this._uri = this.CurrentConversation.CurrentDialog.To;
this.InitSMSInfo();
if (!this.HasContactAddToMultiConversation(contact))
{
if (this.CurrentConversation.CurrentDialog.Participants.Count > 1)
{
this.tsInvite.set_Enabled(true);
this.tsSendFile.set_Enabled(true);
this.tsIVR.set_Enabled(true);
this.tsSendSMS.set_Enabled(true);
this.tsSendSMS.set_Checked(false);
this.tsOperationSendSMS.Radioed = false;
this.rtfInput.Enabled = true;
this.tsOperationSendMessage.Radioed = true;
}
this.lstContacts.Parent.Visible = true;
this.picContact.Visible = false;
buddylistbox_item<string> _item = new buddylistbox_item<string>(contact.DisplayName ?? string.Empty, contact.Presence.MoodPhrase ?? string.Empty, contact.PersonalInfo.Portrait, contact.Uri.Raw);
this.lstContacts.add(_item);
ToolStripMenuItem item = new ToolStripMenuItem(contact.DisplayName);
item.set_Tag(contact);
item.add_Click(delegate (object sender, EventArgs e) {
this.ShowMessageHistory(((sender as ToolStripMenuItem).get_Tag() as Imps.Client.Core.Contact).Uri.Raw);
});
if (this.tsOperationMessageHistory.get_DropDown().get_Items().get_Count() == 0)
{
this.tsOperationMessageHistory.set_DropDown(new menu_widget(this.components));
}
this.tsOperationMessageHistory.get_DropDown().get_Items().Add(item);
ToolStripMenuItem item2 = new ToolStripMenuItem(contact.DisplayName);
item2.set_Tag(contact);
item2.add_Click(delegate (object sender, EventArgs e) {
this.ShowMessageHistory(((sender as ToolStripMenuItem).get_Tag() as Imps.Client.Core.Contact).Uri.Raw);
});
if (this.tsHistory.get_DropDown().get_Items().get_Count() == 0)
{
this.tsHistory.set_DropDown(new menu_widget(this.components));
}
this.tsHistory.get_DropDown().get_Items().Add(item2);
ToolStripMenuItem item3 = new ToolStripMenuItem(contact.DisplayName);
item3.set_Tag(contact);
item3.add_Click(delegate (object sender, EventArgs e) {
this.ShowContactInfo(((sender as ToolStripMenuItem).get_Tag() as Imps.Client.Core.Contact).Uri.Raw);
});
if (this.tsOperationContactInfo.get_DropDown().get_Items().get_Count() == 0)
{
this.tsOperationContactInfo.set_DropDown(new menu_widget(this.components));
}
this.tsOperationContactInfo.get_DropDown().get_Items().Add(item3);
this.menuBlockUsers.get_Items().Add(this.GetBlockMenuItem(contact));
if (this.tsOperationBlock.get_DropDown().get_Items().get_Count() == 0)
{
this.tsOperationBlock.set_DropDown(new menu_widget(this.components));
}
this.tsOperationBlock.get_DropDownItems().Add(this.GetBlockMenuItem(contact));
this.AddContactEvent(contact);
this.InitTooltipInfo();
this.InitFormCaptionAndText();
this.CalculateMultiLstHeight();
}
}
}
private void AddShowRecent100MessageLink()
{
try
{
OleKey newKey = OleKeyManager.Instance.NewKey;
this._historyChatManager.InsertLink(this._historyChatManager.Length - 1, newKey, "查看消息历史", "MOREMESSAGE");
this._historyChatManager.AppendCRLF();
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void AddToFriend(string uri)
{
try
{
IicUri uri2 = new IicUri(uri);
if (uri2.IsContact)
{
Imps.Client.Core.Contact contact = this.CurrentUser.ContactList.FindOrCreateContact(uri, this._op);
if (contact != null)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -