?? contactdelete.cs
字號(hào):
?namespace Imps.Client.Pc.UIContactList
{
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Resource;
using Imps.Common;
using Imps.Common.Permission;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class ContactDelete : XIMDialog
{
private Imps.Client.Core.Contact _contact;
private IFrameworkWindow _iFramework;
private Imps.Client.Core.User _user;
private XButton buttonCancel;
private XButton buttonOK;
private CheckBox checkBoxBlock;
private IContainer components;
private XLabel labelAlert;
private Panel panel1;
public ContactDelete(IFrameworkWindow iFrameworkWindow, string uri)
{
this.InitializeComponent();
this._iFramework = iFrameworkWindow;
this._user = this._iFramework.AccountManager.CurrentUser;
this._contact = this._user.ContactList.Contacts[uri];
if (this._contact == null)
{
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
base.Close();
}
private void buttonOK_Click(object sender, EventArgs e)
{
AsyncBizOperation op = new AsyncBizOperation();
op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this.op_ImpsError);
if (this.checkBoxBlock.Checked)
{
if (!this._user.BlackList.Contains(this._contact.Uri))
{
this._user.ContactList.AsyncAddToBlackList(this._contact.Uri, op);
}
if (this._contact.Type == ContactType.ChatFriend)
{
return;
}
}
else if (this._user.BlackList.Contains(this._contact.Uri))
{
this._user.ContactList.AsyncRemoveFromBlackList(this._contact.Uri, op);
}
this._contact.AsyncDelete(op);
}
private void ContactDelete_Load(object sender, EventArgs e)
{
base.Text = StringTable.Contact.DeleteTitleText;
this.labelAlert.Text = StringTable.Contact.DeleteAlert;
this.checkBoxBlock.Text = StringTable.Contact.DeleteBlock;
if (this._user.BlackList.Contains(this._contact.Uri))
{
this.checkBoxBlock.Text = StringTable.Contact.DeleteBlock_Blocked;
this.checkBoxBlock.Checked = true;
}
else if (this._contact.Permissions[PermissionPointName.Contact].FinalValue == 2)
{
this.checkBoxBlock.Text = StringTable.Contact.DeleteBlock_Reject;
this.checkBoxBlock.Checked = true;
}
else
{
this.checkBoxBlock.Checked = false;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(ContactDelete));
this.labelAlert = new XLabel();
this.checkBoxBlock = new CheckBox();
this.buttonCancel = new XButton();
this.buttonOK = new XButton();
this.panel1 = new Panel();
this.panel1.SuspendLayout();
base.SuspendLayout();
base.menubar.Location = new Point(2, 0x15);
this.labelAlert.BackColor = Color.Transparent;
this.labelAlert.Location = new Point(13, 14);
this.labelAlert.Name = "labelAlert";
this.labelAlert.Size = new Size(0x135, 0x22);
this.labelAlert.TabIndex = 0;
this.labelAlert.Text = "刪除此人會(huì)將其從您的聯(lián)系人名單中移除。但并不能阻止他/她看到您的在線狀態(tài)或向您發(fā)送消息。";
this.checkBoxBlock.AutoSize = true;
this.checkBoxBlock.BackColor = Color.Transparent;
this.checkBoxBlock.Location = new Point(30, 0x38);
this.checkBoxBlock.Name = "checkBoxBlock";
this.checkBoxBlock.Size = new Size(0x9e, 0x11);
this.checkBoxBlock.TabIndex = 2;
this.checkBoxBlock.Text = "我還想將此人加入黑名單";
this.checkBoxBlock.UseVisualStyleBackColor = false;
this.buttonCancel.AutoEllipsis = true;
this.buttonCancel.DialogResult = DialogResult.Cancel;
this.buttonCancel.Location = new Point(0xf3, 0x57);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new Size(0x4b, 0x17);
this.buttonCancel.TabIndex = 0x2b;
this.buttonCancel.Text = "取消";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new EventHandler(this.buttonCancel_Click);
this.buttonOK.DialogResult = DialogResult.OK;
this.buttonOK.Location = new Point(0xa2, 0x57);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new Size(0x4b, 0x17);
this.buttonOK.TabIndex = 0x2a;
this.buttonOK.Text = "確定";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new EventHandler(this.buttonOK_Click);
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.labelAlert);
this.panel1.Controls.Add(this.buttonCancel);
this.panel1.Controls.Add(this.buttonOK);
this.panel1.Controls.Add(this.checkBoxBlock);
this.panel1.Dock = DockStyle.Fill;
this.panel1.Location = new Point(8, 8);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x165, 0xa1);
this.panel1.TabIndex = 0x2c;
base.AcceptButton = this.buttonCancel;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.CancelButton = this.buttonCancel;
base.ClientSize = new Size(0x175, 0xb1);
base.Controls.Add(this.panel1);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MinimizeBox = false;
base.Name = "ContactDelete";
base.Padding = new Padding(8);
base.ShowInTaskbar = false;
base.StartPosition = FormStartPosition.CenterParent;
base.Text = "刪除聯(lián)系人";
base.Load += new EventHandler(this.ContactDelete_Load);
base.Controls.SetChildIndex(this.panel1, 0);
base.Controls.SetChildIndex(base.menubar, 0);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
base.ResumeLayout(false);
}
private void op_ImpsError(object sender, ImpsErrorEventArgs e)
{
try
{
if (base.IsHandleCreated)
{
this._iFramework.UnifiedMessageBox.ShowError(this, e.Summary);
}
}
catch
{
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -