📄 contactnotifywindowmanager.cs
字号:
private void showNotifyWnd_AddBuddyResult(AddBuddyResultEventArgs e)
{
Contact c = e.Contact;
if (c is MobileBuddy)
{
int? relationStatus = c.RelationStatus;
if ((relationStatus.GetValueOrDefault() == 1) && relationStatus.get_HasValue())
{
this.AgreeMobileBuddyEventArgsCol.Add(e);
this.handleArgeeMobileBuddy();
return;
}
}
int? nullable2 = c.RelationStatus;
if (!((nullable2.GetValueOrDefault() == 1) && nullable2.get_HasValue()))
{
int? nullable3 = c.RelationStatus;
if (!((nullable3.GetValueOrDefault() == 2) && nullable3.get_HasValue()))
{
return;
}
}
NotifyWindowAddBuddyResult wnd = new NotifyWindowAddBuddyResult(c, e.IsByMobileNo, null);
wnd.ContentClick += delegate {
this._iFrameworkWindow.ConversationManager.StartConversation(this._iFrameworkWindow.MainWindow, ConversationOperation.ImChat, new string[] { c.Uri.Raw });
wnd.Close();
};
NotifyWindowManager.Add(wnd);
}
public void ShowWindow()
{
if (this._owner.Status == UserAccountStatus.Logon)
{
if (this._addBuddyRequestCol != null)
{
GlobalTimer.Register(new EventHandler(this.addBuddyApplication_onTick), 30);
}
if (this._addBuddyResultEventArgsCol != null)
{
for (int i = this.AddBuddyResultEventArgsCol.get_Count() - 1; i >= 0; i--)
{
this.showNotifyWnd_AddBuddyResult(this.AddBuddyResultEventArgsCol.get_Item(i));
this.AddBuddyResultEventArgsCol.Remove(this.AddBuddyResultEventArgsCol.get_Item(i));
}
}
}
}
private void showWindows_AddBuddy(Contact c, string desc, bool isByMobileNo)
{
FormClosedEventHandler handler = null;
FormClosedEventHandler handler2 = null;
FormClosedEventHandler handler3 = null;
<>c__DisplayClass9 class2;
NotifyWindowAddBuddyRequest n;
if (!c.Uri.IsVodafoneUri)
{
if (isByMobileNo)
{
ReceiveRequestByMobileNoForm form = new ReceiveRequestByMobileNoForm(this._iFrameworkWindow, c, desc);
if (handler == null)
{
handler = new FormClosedEventHandler(class2, (IntPtr) this.<showWindows_AddBuddy>b__0);
}
form.add_FormClosed(handler);
form.Show(this._iFrameworkWindow.MainWindow);
ControlHelper.FlashWindow(form);
n = new NotifyWindowAddBuddyRequest(c, desc, c.PersonalInfo.MobileNo, null);
n.ContentClick += delegate {
form.Activate();
form.WindowState = FormWindowState.Normal;
n.Close();
};
}
else
{
ReceiveRequestBySIDForm form = new ReceiveRequestBySIDForm(this._iFrameworkWindow, c, desc);
form.WindowState = FormWindowState.Minimized;
if (handler2 == null)
{
handler2 = new FormClosedEventHandler(class2, (IntPtr) this.<showWindows_AddBuddy>b__2);
}
form.add_FormClosed(handler2);
form.Show(this._iFrameworkWindow.MainWindow);
ControlHelper.FlashWindow(form);
n = new NotifyWindowAddBuddyRequest(c, desc, null, null);
n.ContentClick += delegate {
form.Activate();
form.WindowState = FormWindowState.Normal;
n.Close();
};
}
}
else
{
ReceiveRequestVodafoneForm form = new ReceiveRequestVodafoneForm(this._iFrameworkWindow, c);
form.WindowState = FormWindowState.Minimized;
if (handler3 == null)
{
handler3 = new FormClosedEventHandler(class2, (IntPtr) this.<showWindows_AddBuddy>b__4);
}
form.add_FormClosed(handler3);
form.Show(this._iFrameworkWindow.MainWindow);
ControlHelper.FlashWindow(form);
n = new NotifyWindowAddBuddyRequest(c, desc, null, null);
n.ContentClick += delegate {
form.Activate();
form.WindowState = FormWindowState.Normal;
n.Close();
};
}
NotifyWindowManager.Add(n);
if (c.Type == ContactType.Stranger)
{
((Stranger) c).CanDispose = true;
}
}
private List<AddBuddyRequest> AddBuddyRequestCol
{
get
{
if (this._addBuddyRequestCol == null)
{
return (this._addBuddyRequestCol = new List<AddBuddyRequest>());
}
return this._addBuddyRequestCol;
}
}
private List<Contact> AddBuddyRequestProposerCol
{
get
{
if (this._addBuddyRequestProposerCol == null)
{
return (this._addBuddyRequestProposerCol = new List<Contact>());
}
return this._addBuddyRequestProposerCol;
}
}
private List<AddBuddyResultEventArgs> AddBuddyResultEventArgsCol
{
get
{
if (this._addBuddyResultEventArgsCol == null)
{
return (this._addBuddyResultEventArgsCol = new List<AddBuddyResultEventArgs>());
}
return this._addBuddyResultEventArgsCol;
}
}
private List<AddBuddyResultEventArgs> AgreeMobileBuddyEventArgsCol
{
get
{
if (this._agreeMobileBuddyEventArgsCol == null)
{
return (this._agreeMobileBuddyEventArgsCol = new List<AddBuddyResultEventArgs>());
}
return this._agreeMobileBuddyEventArgsCol;
}
}
internal class AddBuddyRequest
{
private Imps.Client.Core.Contact _contact;
private string _desc;
private bool _isByMobileNo;
public AddBuddyRequest(Imps.Client.Core.Contact c, string desc, bool isByMobileNo)
{
this._contact = c;
this._desc = desc;
this._isByMobileNo = isByMobileNo;
}
public Imps.Client.Core.Contact Contact
{
get
{
return this._contact;
}
set
{
this._contact = value;
}
}
public string Desc
{
get
{
return this._desc;
}
set
{
this._desc = value;
}
}
public bool IsByMobileNo
{
get
{
return this._isByMobileNo;
}
set
{
this._isByMobileNo = value;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -