⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 permissioncontrol.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 2 页
字号:
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 + -