📄 receiverequestbymobilenoform.cs
字号:
this.panel2.TabIndex = 2;
this.pictureBoxPortrait.BackColor = Color.White;
this.pictureBoxPortrait.BorderColor = Color.FromArgb(0xa4, 170, 220);
this.pictureBoxPortrait.Image = (Image) manager.GetObject("pictureBoxPortrait.Image");
this.pictureBoxPortrait.Location = new Point(4, 3);
this.pictureBoxPortrait.Name = "pictureBoxPortrait";
this.pictureBoxPortrait.Size = new Size(70, 70);
this.pictureBoxPortrait.SizeMode = PortraitSizeMode.Size_64;
this.pictureBoxPortrait.TabIndex = 3;
this.pictureBoxPortrait.Text = "displayPortrait1";
this.pictureBoxPortrait.ToolTipText = "";
this.pictureBoxPortrait.UseHandCursor = false;
this.pictureBoxPortrait.Click += new EventHandler(this.pictureBoxPortrait_Click);
this.labelNickname.AutoEllipsis = true;
this.labelNickname.BorderColor = Color.Empty;
this.labelNickname.ButtonBorderStyle = ButtonBorderStyle.None;
this.labelNickname.Location = new Point(0x4f, 30);
this.labelNickname.Name = "labelNickname";
this.labelNickname.Size = new Size(0x8f, 13);
this.labelNickname.TabIndex = 1;
this.labelNickname.Text = "Nickname";
this.labelNickname.UseMnemonic = false;
this.linkLabelDetail.AutoSize = true;
this.linkLabelDetail.Location = new Point(0x4f, 60);
this.linkLabelDetail.Name = "linkLabelDetail";
this.linkLabelDetail.Size = new Size(0x4f, 13);
this.linkLabelDetail.TabIndex = 2;
this.linkLabelDetail.TabStop = true;
this.linkLabelDetail.Text = "查看详细信息";
this.linkLabelDetail.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabelDetail_LinkClicked);
this.labelHello.BorderColor = Color.Empty;
this.labelHello.ButtonBorderStyle = ButtonBorderStyle.None;
this.labelHello.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
this.labelHello.Location = new Point(0x41, 0x1f);
this.labelHello.Name = "labelHello";
this.labelHello.Size = new Size(0x16c, 0x2b);
this.labelHello.TabIndex = 1;
this.labelHello.Text = "您好:";
this.labelHello.UseMnemonic = false;
this.pictureBoxAlert.Location = new Point(7, 4);
this.pictureBoxAlert.Name = "pictureBoxAlert";
this.pictureBoxAlert.Size = new Size(0x41, 70);
this.pictureBoxAlert.TabIndex = 0;
this.pictureBoxAlert.TabStop = false;
this.panelInfo.BackColor = Color.Transparent;
this.panelInfo.Controls.Add(this.labelRemind);
this.panelInfo.Controls.Add(this.pictureBoxAlert);
this.panelInfo.Location = new Point(9, 0xa5);
this.panelInfo.Name = "panelInfo";
this.panelInfo.Size = new Size(0x1bb, 0x3d);
this.panelInfo.TabIndex = 3;
this.comboBoxGroup.BackColor = Color.White;
this.comboBoxGroup.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxGroup.FormattingEnabled = true;
this.comboBoxGroup.Location = new Point(200, 0xe3);
this.comboBoxGroup.Name = "comboBoxGroup";
this.comboBoxGroup.Size = new Size(0xae, 0x15);
this.comboBoxGroup.TabIndex = 5;
this.panel3.BackColor = Color.Transparent;
this.panel3.Controls.Add(this.linkLabelNewGroup);
this.panel3.Controls.Add(this.buttonOK);
this.panel3.Controls.Add(this.comboBoxGroup);
this.panel3.Controls.Add(this.buttonCancel);
this.panel3.Controls.Add(label2);
this.panel3.Controls.Add(this.panel1);
this.panel3.Controls.Add(this.checkBoxBlock);
this.panel3.Controls.Add(this.panelInfo);
this.panel3.Controls.Add(this.radioButtonReject);
this.panel3.Controls.Add(label);
this.panel3.Controls.Add(this.radioButtonAgree);
this.panel3.Dock = DockStyle.Fill;
this.panel3.Location = new Point(8, 8);
this.panel3.Name = "panel3";
this.panel3.Size = new Size(0x1d0, 0x175);
this.panel3.TabIndex = 0;
this.linkLabelNewGroup.AutoSize = true;
this.linkLabelNewGroup.BackColor = Color.Transparent;
this.linkLabelNewGroup.Location = new Point(380, 0xe7);
this.linkLabelNewGroup.Name = "linkLabelNewGroup";
this.linkLabelNewGroup.Size = new Size(0x37, 13);
this.linkLabelNewGroup.TabIndex = 20;
this.linkLabelNewGroup.TabStop = true;
this.linkLabelNewGroup.Text = "添加新组";
this.linkLabelNewGroup.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabelNewGroup_LinkClicked);
base.AcceptButton = this.buttonOK;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.CancelButton = this.buttonCancel;
base.ClientSize = new Size(480, 0x185);
base.Controls.Add(this.panel3);
base.FormBorderStyle = FormBorderStyle.FixedSingle;
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MinimizeBox = false;
base.Name = "ReceiveRequestByMobileNoForm";
base.Padding = new Padding(8);
base.StartPosition = FormStartPosition.CenterScreen;
base.Text = "邀请函";
base.Load += new EventHandler(this.ReceiveRequestByMobileNoForm_Load);
base.Controls.SetChildIndex(this.panel3, 0);
base.Controls.SetChildIndex(base.menubar, 0);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((ISupportInitialize) this.pictureBoxAlert).EndInit();
this.panelInfo.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
base.ResumeLayout(false);
}
private void InitResourceString()
{
this.labelHello.Text = "";
this.labelNickname.Text = "";
base.Text = StringTable.FormAddBuddy.RequestReceivedFormTextInit;
if (this._desc != "")
{
string str = this._desc;
if (str.Length > 15)
{
str = this._desc.Substring(0, 15) + "...";
}
base.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormText, str);
}
this.setLetterContent();
this.labelRemind.Text = string.Format(StringTable.FormAddBuddy.Remind, this._desc.Replace("&", "&&"), this._user.PersonalInfo.MobileNo);
this.radioButtonAgree.Text = StringTable.FormAddBuddy.Agree;
this.radioButtonReject.Text = StringTable.FormAddBuddy.Reject;
this.checkBoxBlock.Text = StringTable.FormAddBuddy.Block;
this.labelNickname.Text = this._contact.PersonalInfo.Nickname.Value.Replace("&", "&&");
try
{
this.pictureBoxPortrait.Image = this._contact.PersonalInfo.PortraitMedium;
}
catch
{
if (this._contact.PersonalInfo.Gender == Gender.Female)
{
this.pictureBoxPortrait.Image = ImpsPortrait.GetGirlPortrait(0x40, 0x40);
}
else
{
this.pictureBoxPortrait.Image = ImpsPortrait.GetBoyPortrait(0x40, 0x40);
}
}
}
private void linkLabelDetail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (MouseButtons.Left == e.Button)
{
this._iFarmeworkWindow.ContactManager.ShowContactDetail(this._contact.Uri.Raw);
}
}
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._user_StatusChanged);
this._user.ContactList.ContactGroupChanged -= new EventHandler<ContactGroupChangedEventArgs>(this.ContactList_ContactGroupChanged);
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this.StrangerPersonalInfo_PropertiesChanged);
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, true, string.Empty, null);
this._hasHandleRequest = true;
}
}
catch
{
}
base.OnClosed(e);
}
private void pictureBoxPortrait_Click(object sender, EventArgs e)
{
if (this._contact != null)
{
this._iFarmeworkWindow.ContactManager.ShowContactDetail(this._contact.Uri.Raw);
}
}
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 (Exception)
{
}
}
private void ReceiveRequestByMobileNoForm_Load(object sender, EventArgs e)
{
try
{
this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this.StrangerPersonalInfo_PropertiesChanged);
AsyncBizOperation op = new AsyncBizOperation();
this._user.ContactList.AsyncGetContactsInfo(this._contact, op, null, true, new string[] { "portrait-crc", "nickname", "mobile-no" });
this.InitResourceString();
this.InitGroup();
this.pictureBoxPortrait.Cursor = Cursors.Hand;
this.radioButtonAgree.Checked = true;
this.checkBoxBlock.Enabled = false;
}
catch
{
}
}
private void setLetterContent()
{
string str = string.Empty;
if (!string.IsNullOrEmpty(this._contact.PersonalInfo.MobileNo))
{
str = this._contact.PersonalInfo.MobileNo.ToString();
}
string str2 = this._contact.PersonalInfo.Nickname.Value.Replace("&", "&&");
string str3 = this._desc.Replace("&", "&&");
if (str.Length == 0)
{
if ((str2.Length == 0) || (str3 == str2))
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoNicknameMobileNo, str3);
}
else
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoMobileNo, str3, str2);
}
}
else if ((str2.Length == 0) || (str3 == str2))
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoNickname, str3, str);
}
else
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo, str3, str, str2);
}
}
private void StrangerPersonalInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
if (e.ContainsProperty("Portrait"))
{
try
{
this.pictureBoxPortrait.Image = this._contact.PersonalInfo.PortraitMedium;
}
catch
{
if (this._contact.PersonalInfo.Gender == Gender.Female)
{
this.pictureBoxPortrait.Image = ImpsPortrait.GetGirlPortrait(0x40, 0x40);
}
else
{
this.pictureBoxPortrait.Image = ImpsPortrait.GetBoyPortrait(0x40, 0x40);
}
}
}
if (e.ContainsProperty("nickname"))
{
this.labelNickname.Text = this._contact.PersonalInfo.Nickname.Value.Replace("&", "&&");
}
this.setLetterContent();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -