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

📄 myinfoform.cs

📁 飞信的收发使用csharp进行开发
💻 CS
字号:
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.Utils;
    using Imps.Common.Permission;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class MyInfoForm : XIMDialog
    {
        private Contact _contact;
        private IFrameworkWindow _iFrameworkWnd;
        private XButton btnCancel;
        private XButton btnOk;
        private CheckBox cbBirthday;
        private CheckBox cbBiz;
        private CheckBox cbEmail;
        private CheckBox cbPhone;
        private IContainer components;
        private Panel pnlContainer;

        public MyInfoForm(IFrameworkWindow iFrameworkWnd, Contact contact)
        {
            this.InitializeComponent();
            this._iFrameworkWnd = iFrameworkWnd;
            this._contact = contact;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this._contact.Permissions[PermissionPointName.Birthday].SetProposedValueSafely(this.cbBirthday.Checked ? 1 : 0);
            this._contact.Permissions[PermissionPointName.Business].SetProposedValueSafely(this.cbBiz.Checked ? 1 : 0);
            this._contact.Permissions[PermissionPointName.Email].SetProposedValueSafely(this.cbEmail.Checked ? 1 : 0);
            this._contact.Permissions[PermissionPointName.Phone].SetProposedValueSafely(this.cbPhone.Checked ? 1 : 0);
            base.Close();
        }

        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(MyInfoForm));
            this.cbBirthday = new CheckBox();
            this.cbEmail = new CheckBox();
            this.cbBiz = new CheckBox();
            this.cbPhone = new CheckBox();
            this.pnlContainer = new Panel();
            this.btnCancel = new XButton();
            this.btnOk = new XButton();
            XLabel label = new XLabel();
            XLabel label2 = new XLabel();
            this.pnlContainer.SuspendLayout();
            base.SuspendLayout();
            label.AutoSize = true;
            label.BackColor = Color.Transparent;
            label.Location = new Point(12, 9);
            label.Name = "label2";
            label.Size = new Size(0x37, 13);
            label.TabIndex = 0;
            label.Text = "我的信息";
            label2.BackColor = Color.Transparent;
            label2.BorderStyle = BorderStyle.Fixed3D;
            label2.Location = new Point(40, 14);
            label2.Name = "label3";
            label2.Size = new Size(320, 2);
            label2.TabIndex = 1;
            this.cbBirthday.AutoSize = true;
            this.cbBirthday.BackColor = Color.Transparent;
            this.cbBirthday.Location = new Point(0x1a, 0x1f);
            this.cbBirthday.Name = "cbBirthday";
            this.cbBirthday.Size = new Size(0x62, 0x11);
            this.cbBirthday.TabIndex = 2;
            this.cbBirthday.Text = "公开我的生日";
            this.cbBirthday.UseVisualStyleBackColor = false;
            this.cbEmail.AutoSize = true;
            this.cbEmail.BackColor = Color.Transparent;
            this.cbEmail.Location = new Point(0x1a, 0x4d);
            this.cbEmail.Name = "cbEmail";
            this.cbEmail.Size = new Size(0x63, 0x11);
            this.cbEmail.TabIndex = 4;
            this.cbEmail.Text = "公开我的Email";
            this.cbEmail.UseVisualStyleBackColor = false;
            this.cbBiz.AutoSize = true;
            this.cbBiz.BackColor = Color.Transparent;
            this.cbBiz.Location = new Point(0x1a, 100);
            this.cbBiz.Name = "cbBiz";
            this.cbBiz.Size = new Size(290, 0x11);
            this.cbBiz.TabIndex = 5;
            this.cbBiz.Text = "公开我的商务信息(公司名称、公司主页和职位)";
            this.cbBiz.UseVisualStyleBackColor = false;
            this.cbPhone.AutoSize = true;
            this.cbPhone.BackColor = Color.Transparent;
            this.cbPhone.Location = new Point(0x1a, 0x36);
            this.cbPhone.Name = "cbPhone";
            this.cbPhone.Size = new Size(0xc2, 0x11);
            this.cbPhone.TabIndex = 3;
            this.cbPhone.Text = "公开我的工作、家庭和其他电话";
            this.cbPhone.UseVisualStyleBackColor = false;
            this.pnlContainer.BackColor = Color.Transparent;
            this.pnlContainer.Controls.Add(this.btnCancel);
            this.pnlContainer.Controls.Add(this.btnOk);
            this.pnlContainer.Controls.Add(this.cbPhone);
            this.pnlContainer.Controls.Add(this.cbBiz);
            this.pnlContainer.Controls.Add(this.cbEmail);
            this.pnlContainer.Controls.Add(this.cbBirthday);
            this.pnlContainer.Controls.Add(label);
            this.pnlContainer.Controls.Add(label2);
            this.pnlContainer.Dock = DockStyle.Fill;
            this.pnlContainer.Location = new Point(8, 8);
            this.pnlContainer.Name = "pnlContainer";
            this.pnlContainer.Size = new Size(0x17d, 0xd9);
            this.pnlContainer.TabIndex = 0;
            this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Location = new Point(0x113, 130);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x19);
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "取消";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnOk.Location = new Point(0xc2, 130);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new Size(0x4b, 0x19);
            this.btnOk.TabIndex = 6;
            this.btnOk.Text = "确定";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnOk.Click += new EventHandler(this.btnOk_Click);
            base.AcceptButton = this.btnOk;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.CancelButton = this.btnCancel;
            base.ClientSize = new Size(0x18d, 0xe9);
            base.Controls.Add(this.pnlContainer);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.MinimizeBox = false;
            base.Name = "MyInfoForm";
            base.Padding = new Padding(8, 8, 8, 8);
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterParent;
            base.Text = "我的信息";
            base.Load += new EventHandler(this.MyInfoForm_Load);
            base.Controls.SetChildIndex(this.pnlContainer, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            this.pnlContainer.ResumeLayout(false);
            this.pnlContainer.PerformLayout();
            base.ResumeLayout(false);
        }

        private void MyInfoForm_Load(object sender, EventArgs e)
        {
            bool flag = this._contact.Permissions[PermissionPointName.Birthday].ProposedOrFinalValue == 1;
            bool flag2 = this._contact.Permissions[PermissionPointName.Business].ProposedOrFinalValue == 1;
            bool flag3 = this._contact.Permissions[PermissionPointName.Phone].ProposedOrFinalValue == 1;
            bool flag4 = this._contact.Permissions[PermissionPointName.Email].ProposedOrFinalValue == 1;
            this.cbBirthday.Checked = flag;
            this.cbBiz.Checked = flag2;
            this.cbEmail.Checked = flag4;
            this.cbPhone.Checked = flag3;
        }

        public void ShowForm(IWin32Window owner)
        {
            ControlHelper.ShowFormCenterOnParent(this, owner ?? this._iFrameworkWnd.MainWindow);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -