📄 receiverequestvodafoneform.cs
字号:
this.buttonOK.Text = "确定";
this.buttonOK.set_UseVisualStyleBackColor(false);
this.buttonOK.Click += new EventHandler(this.buttonOK_Click);
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.panelContact);
this.panel1.Controls.Add(this.panelLine);
this.panel1.Controls.Add(this.panelReject);
this.panel1.Controls.Add(this.panelAlert);
this.panel1.Controls.Add(this.panelRequest);
this.panel1.Location = new System.Drawing.Point(6, 10);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x1b3, 0x158);
this.panel1.TabIndex = 0x1c;
base.AcceptButton = this.buttonOK;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
base.BaseHeight = 0x1a2;
base.BaseWidth = 0x1ce;
base.CancelButton = this.buttonCancel;
base.ClientSize = new Size(0x1c8, 0x188);
base.Controls.Add(this.buttonCancel);
base.Controls.Add(this.panel1);
base.Controls.Add(this.buttonOK);
base.DisplayLocation = new System.Drawing.Point(0x12, 0x26);
base.Name = "ReceiveRequestVodafoneForm";
base.set_Padding(new Padding(6, 0x19, 0x13, 8));
base.Text = "邀请函";
base.Load += new EventHandler(this.ReceiveRequestVodafoneForm_Load);
this.panelContact.ResumeLayout(false);
this.panelContact.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.panelLine.ResumeLayout(false);
this.panelLine.PerformLayout();
this.panelAlert.ResumeLayout(false);
this.panelAlert.PerformLayout();
this.panelRequest.ResumeLayout(false);
this.panelRequest.PerformLayout();
this.panelReject.ResumeLayout(false);
this.panelReject.PerformLayout();
this.panel1.ResumeLayout(false);
base.ResumeLayout(false);
}
private void initUI()
{
this.labelHello.Text = "";
this.labelNickname.Text = "";
base.Text = StringTable.FormAddBuddy.RequestReceivedFormTextInit;
this.radioButtonAgree.Text = StringTable.FormAddBuddy.Agree;
this.radioButtonReject.Text = StringTable.FormAddBuddy.Reject;
this.checkBoxBlock.Text = StringTable.FormAddBuddy.Block;
this.comboBoxGroup.Enabled = false;
this.checkBoxBlock.Enabled = false;
this.radioButtonAgree.Checked = true;
this.comboBoxGroup.Enabled = true;
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormTextVodafone_Hello, this._contact.Uri.Id);
this.panelAlert.Visible = !this._isServiceSubscribed;
this.panelReject.Visible = !this._isServiceSubscribed;
if (!this._isServiceSubscribed)
{
base.Height = 0x1d8;
this.radioButtonServiceAccept.Checked = true;
}
else
{
base.Height = 0x1a6;
}
this.InitGroup();
this.setUI();
}
private void linkLabelDetail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
if (MouseButtons.Left == e.get_Button())
{
this._iFarmeworkWindow.ContactManager.ShowContactDetail(this, this._contact.Uri.Raw);
}
}
catch
{
}
}
private void linkLabelNewGroup_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
this._iFarmeworkWindow.ContactManager.ShowGroupCreateWindow(this);
}
catch
{
}
}
protected override void OnClosed(EventArgs e)
{
try
{
this._user.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this._user_StatusChanged);
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contactPersonalInfo_PropertiesChanged);
this._user.ContactList.ContactGroupChanged -= new EventHandler<ContactGroupChangedEventArgs>(this, (IntPtr) this.ContactList_ContactGroupChanged);
if ((!this._hasHandleRequest && (this._user.Status != UserAccountStatus.Disconnected)) && ((this._user.Status != UserAccountStatus.Logoff) && (this._user.Status != UserAccountStatus.Logouting)))
{
this._user.ContactList.AsyncHandleContactRequest(this._contact.Uri.ToString(), 2, null, null, false, string.Empty, null);
this._hasHandleRequest = true;
}
}
catch
{
}
base.OnClosed(e);
}
private void radioButtonAgree_CheckedChanged(object sender, EventArgs e)
{
try
{
this.comboBoxGroup.Enabled = this.radioButtonAgree.Checked;
}
catch
{
}
}
private void radioButtonReject_CheckedChanged(object sender, EventArgs e)
{
try
{
this.checkBoxBlock.Checked = false;
this.checkBoxBlock.Enabled = this.radioButtonReject.Checked;
}
catch
{
}
}
private void radioButtonServiceAccept_CheckedChanged(object sender, EventArgs e)
{
try
{
this.radioButtonServiceReject.Checked = !this.radioButtonServiceAccept.Checked;
this.panelRequest.Enabled = this.radioButtonServiceAccept.Checked;
}
catch
{
}
}
private void radioButtonServiceReject_CheckedChanged(object sender, EventArgs e)
{
try
{
this.radioButtonServiceAccept.Checked = !this.radioButtonServiceReject.Checked;
this.panelRequest.Enabled = this.radioButtonServiceAccept.Checked;
}
catch
{
}
}
private void ReceiveRequestVodafoneForm_Load(object sender, EventArgs e)
{
try
{
if (!Imps.Client.Core.FixedClientSetting.Instance.SupportVodafone)
{
base.Close();
}
else
{
this.initUI();
}
}
catch
{
}
}
private void setUI()
{
this.pictureBoxPortrait.Image = this._contact.PersonalInfo.PortraitMedium;
string paddingStringEndEllipsis = StringHelper.GetPaddingStringEndEllipsis(this._contact.PersonalInfo.DisplayName.Replace("&", "&&"), 15);
base.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormTextVodafone, paddingStringEndEllipsis);
this.labelNickname.Text = this._contact.PersonalInfo.DisplayName.Replace("&", "&&");
}
private void vodafoneServiceSubscribe_Successed(object sender, EventArgs e)
{
this._isServiceSubscribed = this._user.IsServiceSubscribed("VodafoneFederation");
if (this._isServiceSubscribed)
{
int? targetGroupId = null;
if (this.radioButtonAgree.Checked && (this.comboBoxGroup.Items.Count > 0))
{
if ((this.comboBoxGroup.SelectedIndex == -1) || (this.comboBoxGroup.SelectedItem == null))
{
this._iFarmeworkWindow.UnifiedMessageBox.ShowInfo(StringTable.FormAddBuddy.MustSelectGroup);
return;
}
ComboBoxItem selectedItem = (ComboBoxItem) this.comboBoxGroup.SelectedItem;
targetGroupId = new int?((int) selectedItem.Value);
if (((int) selectedItem.Value) <= 0)
{
this._iFarmeworkWindow.UnifiedMessageBox.ShowInfo(StringTable.FormAddBuddy.MustSelectGroup);
return;
}
}
this._hasHandleRequest = true;
int result = this.radioButtonAgree.Checked ? 1 : 0;
bool? isBlock = null;
if (result == 0)
{
isBlock = new bool?(this.checkBoxBlock.Checked);
}
AsyncBizOperation op = new AsyncBizOperation();
this._user.ContactList.AsyncHandleContactRequest(this._contact.Uri.Raw, result, isBlock, targetGroupId, false, string.Empty, op);
if (this.checkBoxBlock.Checked)
{
this._user.ContactList.AsyncAddToBlackList(this._contact.Uri, op);
}
base.Close();
}
else
{
this._iFarmeworkWindow.UnifiedMessageBox.ShowError(StringTable.Services.VodafoneSubscribeFailed);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -