?? conversationmanagerimp.cs
字號:
{
for (int j = list.Count - 1; j >= 0; j--)
{
if (!list[j].EnableMultiIM)
{
list.Remove(list[j]);
}
}
}
if (list.Count != 0)
{
Imps.Client.Core.Conversation conversation = null;
string to = null;
if (list.Count == 1)
{
to = list[0].Uri.Raw;
foreach (Imps.Client.Core.Conversation conversation2 in this.CurrentUser.ConversationManager.Conversations)
{
if (conversation2.CurrentDialog != null)
{
if (!conversation2.CurrentDialog.IsMulitiConversation)
{
if (conversation2.CurrentDialog.To == to)
{
conversation = conversation2;
}
}
else if ((conversation2.CurrentDialog.Participants.Count == 1) && (conversation2.CurrentDialog.Participants[0].Contact.Uri.Raw == to))
{
conversation = conversation2;
}
continue;
}
try
{
if (this.CurrentUser.ConversationManager.Conversations.Contains(conversation))
{
this.CurrentUser.ConversationManager.Conversations.Remove(conversation);
}
conversation = null;
continue;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
continue;
}
}
}
ConversationWindow window = null;
if (list.Count == 1)
{
foreach (ConversationWindow window2 in this.AllConversatonWindows)
{
if (window2.Uri == list[0].Uri.Raw)
{
window = window2;
break;
}
if ((conversation != null) && (window2.CurrentConversation == conversation))
{
window = window2;
break;
}
}
if (window == null)
{
Imps.Client.Core.Contact contact2 = list[0];
if (((contact2.RelationStatus != 1) || (contact2 is Imps.Client.Core.ChatFriend)) || (contact2 is Stranger))
{
string str2;
if ((contact2.RelationStatus == 0) || (contact2.RelationStatus == 2))
{
str2 = "由于對方尚未同意成為您的好友,所以您不能給對方發消息,\r\n\r\n是否再次發送添加好友申請?";
}
else
{
str2 = "由于對方不是您的好友,所以您不能給對方發送消息,\r\n\r\n是否添加對方為好友?";
}
if (this._frameworkWnd.UnifiedMessageBox.ShowConfirmation(this._frameworkWnd as IWin32Window, str2) == DialogResult.Yes)
{
string mobileNo = string.IsNullOrEmpty(contact2.PersonalInfo.MobileNo) ? contact2.PersonalInfo.MobileNoUserSet : contact2.PersonalInfo.MobileNo;
this._frameworkWnd.ContactManager.ShowAddBuddyWindow(this._frameworkWnd as IWin32Window, mobileNo, new long?(contact2.Uri.Sid), string.Empty, null, ContactType.ImpsContact);
}
return;
}
}
}
if (conversation == null)
{
conversation = this.CurrentUser.ConversationManager.OpenConversation(to, list);
}
if (window == null)
{
window = this.CreateConversationWindow(conversation);
window.Show();
}
else
{
if (window.CurrentConversation == null)
{
window.CurrentConversation = conversation;
}
Imps.Client.Utils.Win32.NativeMethods.ShowWindow(window.Handle, 9);
window.Activate();
}
if (operation == ConversationOperation.SendFile)
{
if (context == null)
{
window.SendFile();
}
else if (context is string[])
{
foreach (string str4 in context as string[])
{
window.SendFile(str4);
}
}
}
if ((operation == ConversationOperation.SmsChat) && (contactUris.Length == 1))
{
window.SendSMS = true;
}
}
}
}
}
}
catch (Exception exception2)
{
ClientLogger.WriteException(exception2);
}
}
public void StartConversationAfterSelectContacts(IWin32Window owner, List<Imps.Client.Core.Contact> list)
{
try
{
InviteForm form = new InviteForm(this._frameworkWnd, StringTable.Conversation.MsgSelectConversationContacts, this.CurrentUser.Configuration.SystemSetting.SysConversationSetting.MaxParticipations - 1, true, true, list, null, false, false, false, false);
if (owner is Form)
{
form.Location = (owner as Form).Location;
}
if ((form.ShowDialog(owner) == DialogResult.OK) && (form.SelectedContacts.Count != 0))
{
string[] contactUris = new string[form.SelectedContacts.Count];
for (int i = 0; i < form.SelectedContacts.Count; i++)
{
contactUris[i] = form.SelectedContacts[i].Uri.Raw;
}
this.StartConversation(owner, ConversationOperation.ImChat, null, contactUris);
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
public void StartMultiSMS(IWin32Window owner)
{
this.StartMultiSMS(owner, null);
}
public void StartMultiSMS(IWin32Window owner, List<Imps.Client.Core.Contact> list)
{
if (((this._smsForm == null) || this._smsForm.IsDisposed) || (list != null))
{
if (this._smsForm != null)
{
this._smsForm.Close();
}
this._smsForm = new GroupSMSForm(this.FrameworkWnd, list);
ControlHelper.ShowFormCenterOnParent(this._smsForm, owner);
}
else
{
Imps.Client.Utils.Win32.NativeMethods.ShowWindow(this._smsForm.Handle, 9);
this._smsForm.Activate();
}
}
public List<ConversationWindow> AllConversatonWindows
{
get
{
if (this._allConversatonWindows == null)
{
this._allConversatonWindows = new List<ConversationWindow>();
}
return this._allConversatonWindows;
}
set
{
this._allConversatonWindows = value;
}
}
internal Imps.Client.Core.User CurrentUser
{
get
{
return this._frameworkWnd.AccountManager.CurrentUser;
}
}
public bool ForceToCloseWindow
{
get
{
return this._forceToCloseWindow;
}
set
{
this._forceToCloseWindow = value;
}
}
internal IFrameworkWindow FrameworkWnd
{
get
{
return this._frameworkWnd;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -