📄 blacklistaddform.cs
字号:
this.rbMobile.set_AutoSize(true);
this.rbMobile.Checked = true;
this.rbMobile.Location = new System.Drawing.Point(6, 0x16);
this.rbMobile.Name = "rbMobile";
this.rbMobile.Size = new Size(0x49, 0x11);
this.rbMobile.TabIndex = 0;
this.rbMobile.TabStop = true;
this.rbMobile.Text = "手机号:";
this.rbMobile.set_UseVisualStyleBackColor(true);
this.rbMobile.CheckedChanged += new EventHandler(this.rbMobile_CheckedChanged);
this.xbOK.AutoArrangementX = true;
this.xbOK.AutoSizeToImage = false;
this.xbOK.BackColor = Color.Transparent;
this.xbOK.BackgroundImageDisable = null;
this.xbOK.BackgroundImageDown = null;
this.xbOK.BackgroundImageHover = null;
this.xbOK.ChangeSkin = true;
this.xbOK.Location = new System.Drawing.Point(0x75, 0xcb);
this.xbOK.Name = "xbOK";
this.xbOK.Size = new Size(0x4b, 0x17);
this.xbOK.TabIndex = 5;
this.xbOK.Text = "确定";
this.xbOK.set_UseVisualStyleBackColor(false);
this.xbOK.Click += new EventHandler(this.xbOK_Click);
this.xbCancel.AutoArrangementX = true;
this.xbCancel.AutoSizeToImage = false;
this.xbCancel.BackColor = Color.Transparent;
this.xbCancel.BackgroundImageDisable = null;
this.xbCancel.BackgroundImageDown = null;
this.xbCancel.BackgroundImageHover = null;
this.xbCancel.ChangeSkin = true;
this.xbCancel.DialogResult = DialogResult.Cancel;
this.xbCancel.Location = new System.Drawing.Point(0xc6, 0xcb);
this.xbCancel.Name = "xbCancel";
this.xbCancel.Size = new Size(0x4b, 0x17);
this.xbCancel.TabIndex = 6;
this.xbCancel.Text = "取消";
this.xbCancel.set_UseVisualStyleBackColor(false);
this.xbCancel.Click += new EventHandler(this.xbCancel_Click);
base.AcceptButton = this.xbOK;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
base.BaseHeight = 320;
base.BaseWidth = 0x11f;
base.CancelButton = this.xbCancel;
base.ClientSize = new Size(0x119, 0x126);
base.Controls.Add(this.panel1);
base.Controls.Add(this.xbCancel);
base.Controls.Add(this.xbOK);
base.DisplayLocation = new System.Drawing.Point(0x12, 0x26);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.Name = "BlackListAddForm";
base.set_Padding(new Padding(1, 0x16, 13, 4));
base.StartPosition = FormStartPosition.CenterParent;
base.Text = "添加黑名单";
this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
base.ResumeLayout(false);
}
private void InitializeWndlessControl()
{
this._controlCollection = new WndlessControlCollection(this.groupBox2);
this.pictureBoxPortrait = new WndlessPortrait();
this.pictureBoxPortrait.BackColor = Color.White;
this.pictureBoxPortrait.BorderColor = Color.FromArgb(0xa4, 170, 220);
this.pictureBoxPortrait.Cursor = Cursors.Hand;
this.pictureBoxPortrait.Location = new System.Drawing.Point(7, 0x13);
this.pictureBoxPortrait.Size = new Size(50, 50);
this.pictureBoxPortrait.PortraitSize = 40;
this.pictureBoxPortrait.ToolTipText = "";
this.pictureBoxPortrait.Click += new EventHandler(this.pictureBoxPortrait_Click);
this._controlCollection.Add(this.pictureBoxPortrait);
}
private void linkLabelDetail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.pictureBoxPortrait_Click(sender, e);
}
protected override void OnClosed(EventArgs e)
{
try
{
this._user.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this._user_StatusChanged);
if (this._lastContact != null)
{
this._lastContact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contactInfo_PropertiesChanged);
}
}
catch
{
}
base.OnClosed(e);
}
private void pictureBoxPortrait_Click(object sender, EventArgs e)
{
try
{
this._frameworkWindow.ContactManager.ShowContactDetail(this, this.LastContact.Uri.Raw);
}
catch
{
}
}
private void rbMobile_CheckedChanged(object sender, EventArgs e)
{
if (!this.rbMobile.Checked)
{
this.tbMobile.Text = string.Empty;
this.tbMobile.Enabled = false;
}
else
{
this.tbMobile.Enabled = true;
}
}
private void rbSID_CheckedChanged(object sender, EventArgs e)
{
if (!this.rbSID.Checked)
{
this.tbSid.Text = string.Empty;
this.tbSid.Enabled = false;
}
else
{
this.tbSid.Enabled = true;
}
}
private void showContactInfo(Imps.Client.Core.ContactInfo personalInfo)
{
bool flag = personalInfo.Provision != 0;
this.linkLabelDetail.Visible = true;
this.pictureBoxPortrait.Visible = true;
this.pictureBoxPortrait.Cursor = Cursors.Hand;
if (flag)
{
this.pictureBoxPortrait.Image = personalInfo.Portrait;
}
else
{
this.pictureBoxPortrait.Image = ImpsPortrait.GetMobilePortrait(0x60, 0x60);
}
if (!string.IsNullOrEmpty(personalInfo.Nickname.Value))
{
this.lNickName.Text = string.Format("昵称:{0}", personalInfo.DisplayName);
}
}
private void tbMobile_TextChanged(object sender, EventArgs e)
{
try
{
if (Regex.IsMatch(this.tbMobile.Text, @"^((\+)\d)?\d*$"))
{
this.findContactByMobileOrSid(true);
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void tbSid_TextChanged(object sender, EventArgs e)
{
try
{
if (Regex.IsMatch(this.tbSid.Text, @"^((\+)\d)?\d*$"))
{
this.findContactByMobileOrSid(false);
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void xbCancel_Click(object sender, EventArgs e)
{
base.DialogResult = DialogResult.Cancel;
this.tbMobile.Text = string.Empty;
this.tbSid.Text = string.Empty;
base.Close();
}
private void xbOK_Click(object sender, EventArgs e)
{
try
{
if (this.LastContact != null)
{
AsyncBizOperation op = new AsyncBizOperation();
this._user.ContactList.AsyncAddToBlackList(this.LastContact.Uri, op);
base.DialogResult = DialogResult.OK;
this.tbMobile.Text = string.Empty;
this.tbSid.Text = string.Empty;
}
else
{
if (this.rbMobile.Checked)
{
BalloonHelper.ShowInputErrorBallon(this.tbMobile, "无效的手机号,请重新输入!");
}
if (this.rbSID.Checked)
{
BalloonHelper.ShowInputErrorBallon(this.tbSid, "无效的飞信号,请重新输入!");
}
}
}
catch
{
}
}
private Imps.Client.Core.Contact LastContact
{
get
{
return this._lastContact;
}
set
{
if (this._lastContact != null)
{
this._lastContact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contactInfo_PropertiesChanged);
}
this.clearContactInfo();
this._lastContact = value;
if (this._lastContact != null)
{
this.showContactInfo(this._lastContact.PersonalInfo);
this._lastContact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.contactInfo_PropertiesChanged);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -