?? permissioncontrol.cs
字號:
?namespace Imps.Client.Pc.UIContactList
{
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Common;
using Imps.Common.Permission;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PermissionControl : ProfileControlBase
{
private Imps.Client.Core.Contact _contact;
private IFrameworkWindow _iFrameworkWindow;
private MyInfoForm _myInfoForm;
private Imps.Client.Core.User _user;
private CheckBox cbShareInfo;
private CheckBox checkBoxBlock;
private CheckBox chkAllowContact;
private CheckBox chkPresence;
private IContainer components;
private XLabel label5;
private XLabel lbIvr;
private XButton xbtnBlackList;
private XButton xbtnMore;
private XComboBox xcbIvr;
public PermissionControl(IFrameworkWindow iFrameworkWnd, Imps.Client.Core.Contact contact)
{
this.InitializeComponent();
this._iFrameworkWindow = iFrameworkWnd;
this._contact = contact;
this._user = iFrameworkWnd.AccountManager.CurrentUser;
this.HandleUiChanged();
this.initIvrBuddyComboBox();
}
private void checkBoxBlock_CheckedChanged(object sender, EventArgs e)
{
this.xcbIvr.Enabled = !this.checkBoxBlock.Checked;
this.chkAllowContact.Enabled = !this.checkBoxBlock.Checked;
this.xcbIvr.Enabled = !this.checkBoxBlock.Checked;
this.cbShareInfo.Enabled = !this.checkBoxBlock.Checked;
this.chkPresence.Enabled = !this.checkBoxBlock.Checked;
this.xbtnMore.Enabled = !this.checkBoxBlock.Checked;
}
private void chkAllowContact_CheckedChanged(object sender, EventArgs e)
{
if (this._contact.Type != ContactType.MobileBuddy)
{
this.xcbIvr.Enabled = this.chkAllowContact.Checked;
}
if (!this.chkAllowContact.Checked)
{
this.xcbIvr.SelectedValue = 0;
}
else
{
this.xcbIvr.SelectedValue = this._contact.Permissions.PermissionPointIvr.FinalValue;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private int getIvrValue()
{
return ((this.xcbIvr.SelectedValue == null) ? -1 : ((int) this.xcbIvr.SelectedValue));
}
protected override void HandleUiChanged()
{
this.cbShareInfo.CheckedChanged += new EventHandler(this.UIData_Changed);
this.checkBoxBlock.CheckedChanged += new EventHandler(this.UIData_Changed);
this.xcbIvr.SelectedIndexChanged += new EventHandler(this.UIData_Changed);
this.xbtnBlackList.Click += new EventHandler(this.UIData_Changed);
this.xbtnMore.Click += new EventHandler(this.UIData_Changed);
this.chkAllowContact.Click += new EventHandler(this.UIData_Changed);
this.chkPresence.Click += new EventHandler(this.UIData_Changed);
}
private void InitializeComponent()
{
this.cbShareInfo = new CheckBox();
this.xbtnMore = new XButton();
this.xbtnBlackList = new XButton();
this.xcbIvr = new XComboBox();
this.checkBoxBlock = new CheckBox();
this.label5 = new XLabel();
this.chkAllowContact = new CheckBox();
this.chkPresence = new CheckBox();
this.lbIvr = new XLabel();
XLabel label = new XLabel();
XLabel label2 = new XLabel();
XLabel label3 = new XLabel();
XLabel label4 = new XLabel();
XLabel label5 = new XLabel();
XLabel label6 = new XLabel();
base.SuspendLayout();
label.AutoSize = true;
label.BorderColor = Color.Empty;
label.ButtonBorderStyle = ButtonBorderStyle.None;
label.Location = new Point(3, 11);
label.Name = "label2";
label.Size = new Size(0x37, 13);
label.TabIndex = 0;
label.Text = "我的信息";
label2.BorderColor = Color.Empty;
label2.BorderStyle = BorderStyle.Fixed3D;
label2.ButtonBorderStyle = ButtonBorderStyle.None;
label2.Location = new Point(0x3a, 0x11);
label2.Name = "label3";
label2.Size = new Size(300, 2);
label2.TabIndex = 1;
label3.AutoSize = true;
label3.BorderColor = Color.Empty;
label3.ButtonBorderStyle = ButtonBorderStyle.None;
label3.Location = new Point(3, 0xca);
label3.Name = "label1";
label3.Size = new Size(0x2b, 13);
label3.TabIndex = 6;
label3.Text = "黑名單";
label4.BorderColor = Color.Empty;
label4.BorderStyle = BorderStyle.Fixed3D;
label4.ButtonBorderStyle = ButtonBorderStyle.None;
label4.Location = new Point(0x3a, 0xcf);
label4.Name = "label4";
label4.Size = new Size(300, 2);
label4.TabIndex = 7;
label5.AutoSize = true;
label5.BorderColor = Color.Empty;
label5.ButtonBorderStyle = ButtonBorderStyle.None;
label5.Location = new Point(3, 0x6f);
label5.Name = "label6";
label5.Size = new Size(0x37, 13);
label5.TabIndex = 11;
label5.Text = "和我聯系";
label6.BorderColor = Color.Empty;
label6.BorderStyle = BorderStyle.Fixed3D;
label6.ButtonBorderStyle = ButtonBorderStyle.None;
label6.Location = new Point(0x3a, 0x76);
label6.Name = "label7";
label6.Size = new Size(300, 2);
label6.TabIndex = 12;
this.cbShareInfo.AutoSize = true;
this.cbShareInfo.Location = new Point(20, 0x22);
this.cbShareInfo.Name = "cbShareInfo";
this.cbShareInfo.Size = new Size(0x92, 0x11);
this.cbShareInfo.TabIndex = 2;
this.cbShareInfo.Text = "向對方公開我的手機號碼和姓名";
this.cbShareInfo.UseVisualStyleBackColor = true;
this.xbtnMore.Location = new Point(0xee, 30);
this.xbtnMore.Name = "xbtnMore";
this.xbtnMore.Size = new Size(0x69, 0x17);
this.xbtnMore.TabIndex = 3;
this.xbtnMore.Text = "公開更多...";
this.xbtnMore.UseVisualStyleBackColor = true;
this.xbtnMore.Click += new EventHandler(this.xbtnMore_Click);
this.xbtnBlackList.Location = new Point(0xee, 0xe0);
this.xbtnBlackList.Name = "xbtnBlackList";
this.xbtnBlackList.Size = new Size(0x69, 0x17);
this.xbtnBlackList.TabIndex = 9;
this.xbtnBlackList.Text = "黑名單管理...";
this.xbtnBlackList.UseVisualStyleBackColor = true;
this.xbtnBlackList.Click += new EventHandler(this.xbtnBlackList_Click);
this.xcbIvr.BackColor = Color.White;
this.xcbIvr.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbIvr.FormattingEnabled = true;
this.xcbIvr.Location = new Point(0x65, 0xa6);
this.xcbIvr.Name = "xcbIvr";
this.xcbIvr.Size = new Size(0xf2, 0x15);
this.xcbIvr.TabIndex = 5;
this.xcbIvr.MouseHover += new EventHandler(this.xcbIvr_MouseHover);
this.checkBoxBlock.AutoSize = true;
this.checkBoxBlock.Location = new Point(20, 0xe4);
this.checkBoxBlock.Name = "checkBoxBlock";
this.checkBoxBlock.Size = new Size(0x92, 0x11);
this.checkBoxBlock.TabIndex = 8;
this.checkBoxBlock.Text = "我要將對方加入黑名單";
this.checkBoxBlock.UseVisualStyleBackColor = true;
this.checkBoxBlock.CheckedChanged += new EventHandler(this.checkBoxBlock_CheckedChanged);
this.label5.BorderColor = Color.Empty;
this.label5.ButtonBorderStyle = ButtonBorderStyle.None;
this.label5.Location = new Point(30, 0x100);
this.label5.Name = "label5";
this.label5.Size = new Size(0x128, 0x33);
this.label5.TabIndex = 10;
this.label5.Text = "將對方加入黑名單后,對方將不能看到您在線,也不能和您聯系(包括發送即時消息、短信、移動文件傳輸、手機語聊等所有聯系方式)。";
this.chkAllowContact.AutoSize = true;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -