📄 receiverequestbymobilenoform.cs
字号:
this.panel1.Dock = DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x189, 0x56);
this.panel1.TabIndex = 0;
this.panel1.TabStop = true;
this.linkLabelDetail.set_AutoSize(true);
this.linkLabelDetail.LinkColor = Color.Green;
this.linkLabelDetail.Location = new System.Drawing.Point(13, 70);
this.linkLabelDetail.Name = "linkLabelDetail";
this.linkLabelDetail.Size = new Size(0x37, 13);
this.linkLabelDetail.TabIndex = 1;
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 System.Drawing.Point(0x4c, 0x13);
this.labelHello.Name = "labelHello";
this.labelHello.Size = new Size(0x131, 0x40);
this.labelHello.TabIndex = 0;
this.labelHello.Text = "您好:";
this.labelHello.UseMnemonic = false;
this.panelInfo.BackColor = Color.Transparent;
this.panelInfo.Controls.Add(this.labelRemind);
this.panelInfo.Location = new System.Drawing.Point(9, 0x69);
this.panelInfo.Name = "panelInfo";
this.panelInfo.Size = new Size(0x173, 0x29);
this.panelInfo.TabIndex = 3;
this.comboBoxGroup.BackColor = Color.White;
this.comboBoxGroup.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxGroup.EmptyTextTip = "";
this.comboBoxGroup.EmptyTextTipColor = Color.DarkGray;
this.comboBoxGroup.set_FormattingEnabled(true);
this.comboBoxGroup.Location = new System.Drawing.Point(0x94, 0xb6);
this.comboBoxGroup.Name = "comboBoxGroup";
this.comboBoxGroup.Size = new Size(0x90, 0x15);
this.comboBoxGroup.TabIndex = 3;
this.panelMain.BackColor = Color.Transparent;
this.panelMain.Controls.Add(this.tbDisplayName);
this.panelMain.Controls.Add(this.label2);
this.panelMain.Controls.Add(this.label3);
this.panelMain.Controls.Add(this.panel1);
this.panelMain.Controls.Add(this.uButton1);
this.panelMain.Controls.Add(this.comboBoxGroup);
this.panelMain.Controls.Add(label2);
this.panelMain.Controls.Add(this.checkBoxBlock);
this.panelMain.Controls.Add(this.panelInfo);
this.panelMain.Controls.Add(this.radioButtonReject);
this.panelMain.Controls.Add(label);
this.panelMain.Controls.Add(this.radioButtonAgree);
this.panelMain.Location = new System.Drawing.Point(3, 8);
this.panelMain.Name = "panelMain";
this.panelMain.Size = new Size(0x189, 0x116);
this.panelMain.TabIndex = 0;
this.tbDisplayName.Location = new System.Drawing.Point(0x94, 0x94);
this.tbDisplayName.Name = "tbDisplayName";
this.tbDisplayName.MaxLength = 20;
this.tbDisplayName.Size = new Size(0x8d, 20);
this.tbDisplayName.TabIndex = 2;
this.tbDisplayName.KeyPress += new KeyPressEventHandler(this.tbDisplayName_KeyPress);
this.label2.set_AutoSize(true);
this.label2.Location = new System.Drawing.Point(0x43, 0xb9);
this.label2.Name = "label2";
this.label2.Size = new Size(0x4f, 13);
this.label2.TabIndex = 0x2b;
this.label2.Text = "添加到该分组";
this.label3.set_AutoSize(true);
this.label3.Location = new System.Drawing.Point(0x127, 0x9b);
this.label3.Name = "label3";
this.label3.Size = new Size(0x37, 13);
this.label3.TabIndex = 5;
this.label3.Text = "(可选)";
this.uButton1.BackgroundImage = (Image) manager.GetObject("uButton1.BackgroundImage");
this.uButton1.DisabledBackgroundImage = null;
this.uButton1.HoverBackgroundImage = (Image) manager.GetObject("uButton1.HoverBackgroundImage");
this.uButton1.Location = new System.Drawing.Point(0x12a, 0xb6);
this.uButton1.Name = "uButton1";
this.uButton1.NormalBackgroundImage = (Image) manager.GetObject("uButton1.NormalBackgroundImage");
this.uButton1.PushedBackgroundImage = (Image) manager.GetObject("uButton1.PushedBackgroundImage");
this.uButton1.Size = new Size(0x53, 0x15);
this.uButton1.TabIndex = 4;
this.uButton1.Text = "添加分组";
this.uButton1.TextAlign = ContentAlignment.MiddleRight;
this.uButton1.set_UseVisualStyleBackColor(true);
this.uButton1.Click += new EventHandler(this.uButton1_Click);
base.AcceptButton = this.buttonOK;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
base.BaseHeight = 0x195;
base.BaseWidth = 0x19d;
base.CancelButton = this.buttonCancel;
base.ClientSize = new Size(0x19d, 0x195);
base.Controls.Add(this.panelMain);
base.Controls.Add(this.buttonOK);
base.Controls.Add(this.buttonCancel);
base.DisplayLocation = new System.Drawing.Point(0x12, 0x26);
base.DisplaySize = new Size(0x19d, 0x195);
base.FormBorderStyle = FormBorderStyle.FixedSingle;
base.MinimizeBox = false;
base.Name = "ReceiveRequestByMobileNoForm";
base.set_Padding(new Padding(8));
base.StartPosition = FormStartPosition.CenterScreen;
base.Text = "邀请函";
base.Load += new EventHandler(this.ReceiveRequestByMobileNoForm_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panelInfo.ResumeLayout(false);
this.panelMain.ResumeLayout(false);
this.panelMain.PerformLayout();
base.ResumeLayout(false);
}
private void InitializeWndlessControl()
{
this._controlCollection = new WndlessControlCollection(this.panel1);
this._pictureBoxPortrait = new WndlessPortrait();
this._pictureBoxPortrait.Cursor = Cursors.Hand;
this._pictureBoxPortrait.Location = new System.Drawing.Point(8, 8);
this._pictureBoxPortrait.Size = new Size(0x40, 0x40);
this._pictureBoxPortrait.PortraitSize = 0x30;
this._pictureBoxPortrait.ToolTipText = "";
this._pictureBoxPortrait.Click += new EventHandler(this.pictureBoxPortrait_Click);
this._controlCollection.Add(this._pictureBoxPortrait);
}
private void InitResourceString()
{
this.labelHello.Text = "";
base.Text = StringTable.FormAddBuddy.RequestReceivedFormTextInit;
if (this._desc != "")
{
string paddingStringEndEllipsis = StringHelper.GetPaddingStringEndEllipsis(this._desc, 15);
base.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormText, paddingStringEndEllipsis);
}
this.setLetterContent();
this.labelRemind.Text = StringTable.FormAddBuddy.Remind;
this.radioButtonAgree.Text = StringTable.FormAddBuddy.Agree;
this.radioButtonReject.Text = StringTable.FormAddBuddy.Reject;
this.checkBoxBlock.Text = StringTable.FormAddBuddy.Block;
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.get_Button())
{
this._iFarmeworkWindow.ContactManager.ShowContactDetail(this._contact.Uri.Raw);
}
}
protected override void OnClosed(EventArgs e)
{
try
{
this._user.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this._user_StatusChanged);
this._user.ContactList.ContactGroupChanged -= new EventHandler<ContactGroupChangedEventArgs>(this, (IntPtr) this.ContactList_ContactGroupChanged);
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) 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;
this.tbDisplayName.Enabled = this.radioButtonAgree.Checked;
this.uButton1.Enabled = this.radioButtonAgree.Checked;
}
catch
{
}
}
private void radioButtonReject_CheckedChanged(object sender, EventArgs e)
{
try
{
this.checkBoxBlock.Checked = false;
this.checkBoxBlock.Enabled = this.radioButtonReject.Checked;
this.uButton1.Enabled = false;
}
catch (Exception)
{
}
}
private void ReceiveRequestByMobileNoForm_Load(object sender, EventArgs e)
{
try
{
this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.StrangerPersonalInfo_PropertiesChanged);
this.InitResourceString();
this.InitGroup();
this._pictureBoxPortrait.Cursor = Cursors.Hand;
this.radioButtonAgree.Checked = true;
this.checkBoxBlock.Enabled = false;
}
catch
{
}
}
private void setLetterContent()
{
string text = string.Empty;
if (!string.IsNullOrEmpty(this._contact.PersonalInfo.MobileNo))
{
text = this._contact.PersonalInfo.MobileNo.ToString();
}
string text2 = this._contact.PersonalInfo.Nickname.Value;
string text3 = this._desc;
if (text.Length == 0)
{
if ((text2.Length == 0) || (text3 == text2))
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoNicknameMobileNo, text3);
}
else
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoMobileNo, text3, text2);
}
}
else if ((text2.Length == 0) || (text3 == text2))
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo_NoNickname, text3, text);
}
else
{
this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedLetterContentMobileNo, text3, text, text2);
}
}
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);
}
}
}
this.setLetterContent();
}
private void tbDisplayName_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
if (e.KeyChar < ' ')
{
}
}
catch
{
}
}
private void uButton1_Click(object sender, EventArgs e)
{
try
{
this._iFarmeworkWindow.ContactManager.ShowGroupCreateWindow(this);
}
catch
{
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -