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

📄 initprofile.cs

📁 飞信的收发使用csharp进行开发
💻 CS
字号:
namespace Imps.Client.Pc.Provsion2
{
    using Imps.Client.Core;
    using Imps.Client.Pc.BizControls;
    using Imps.Client.Pc.Controls;
    using Imps.Client.Resource;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class InitProfile : XIMDialog
    {
        private ProfileControlBase _curControl;
        private ProvsionData _pdata;
        private XButton btnCancel;
        private XButton btnConfirm;
        private IContainer components;
        private ProfileControlBase[] controls;
        private Label label1;
        private XLabel lbMobileNo;
        private listbox_widget_t<headicon> lbOptionItems;
        private XLabel lbSid;
        private headiconlist_drawer m_headicon_list_drawer = new headiconlist_drawer();
        private Panel pnlContainer;
        private Panel pnlProfile;
        private Panel pnlTop;

        public InitProfile(ProvsionData pdata)
        {
            this._pdata = pdata;
            this.InitializeComponent();
            this.LoadResource();
            this.Init();
        }

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

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (this._curControl.GetValidData())
            {
                base.Close();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Init()
        {
            this.lbOptionItems.add(new headicon(null, "基本资料"));
            this.lbOptionItems.add(new headicon(null, "扩展资料"));
            this.lbOptionItems.add(new headicon(null, "商务信息"));
            this.controls = new ProfileControlBase[] { new InitBasicProfile(this._pdata), new InitExProfile(this._pdata), new InitBizProfile(this._pdata) };
            this.LoadControl(this.controls[0]);
            this.lbOptionItems.SelectedIndex = 0;
            base.Text = "详细资料";
            this.lbOptionItems.SelectedIndexChanged += new EventHandler(this.lbOptionItems_SelectedIndexChanged);
            this.lbOptionItems.SelectedIndexChanging += new listbox_widget.cancel_select_event_handler(this.lbOptionItems_SelectedIndexChanging);
            this.lbMobileNo.Text = string.Format(this.lbMobileNo.Text, this._pdata.MobileNo);
            this.lbSid.Text = string.Format(this.lbSid.Text, AppDictionary.SidLocalName, this._pdata.ProvsionUserInfo.Sid);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(InitProfile));
            this.btnConfirm = new XButton();
            this.btnCancel = new XButton();
            this.pnlProfile = new Panel();
            this.pnlContainer = new Panel();
            this.label1 = new Label();
            this.lbMobileNo = new XLabel();
            this.lbSid = new XLabel();
            this.lbOptionItems = new listbox_widget_t<headicon>();
            this.pnlTop = new Panel();
            this.pnlContainer.SuspendLayout();
            this.pnlTop.SuspendLayout();
            base.SuspendLayout();
            this.lbMobileNo.AutoSize = true;
            this.lbMobileNo.Location = new Point(12, 9);
            this.lbMobileNo.Name = "lbMobileNo";
            this.lbMobileNo.Size = new Size(0x51, 13);
            this.lbMobileNo.TabIndex = 0;
            this.lbMobileNo.Text = "手机号码:{0}";
            this.lbSid.AutoSize = true;
            this.lbSid.Location = new Point(0xe7, 9);
            this.lbSid.Name = "lbSid";
            this.lbSid.Size = new Size(0x2f, 13);
            this.lbSid.TabIndex = 1;
            this.lbSid.Text = "{0}:{1}";
            base.menubar.Location = new Point(3, 30);
            this.btnConfirm.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnConfirm.Location = new Point(0x159, 0x19d);
            this.btnConfirm.Name = "btnConfirm";
            this.btnConfirm.Size = new Size(0x4b, 0x15);
            this.btnConfirm.TabIndex = 3;
            this.btnConfirm.Text = "确定";
            this.btnConfirm.UseVisualStyleBackColor = true;
            this.btnConfirm.Click += new EventHandler(this.btnConfirm_Click);
            this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Location = new Point(0x1aa, 0x19d);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x15);
            this.btnCancel.TabIndex = 4;
            this.btnCancel.Text = "取消";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.pnlTop.Controls.Add(this.lbSid);
            this.pnlTop.Controls.Add(this.lbMobileNo);
            this.pnlTop.Location = new Point(0x7e, 4);
            this.pnlTop.Name = "pnlTop";
            this.pnlTop.Size = new Size(390, 30);
            this.pnlTop.TabIndex = 5;
            this.pnlProfile.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.pnlProfile.AutoScroll = true;
            this.pnlProfile.BackColor = Color.Transparent;
            this.pnlProfile.Location = new Point(0x7e, 30);
            this.pnlProfile.Name = "pnlProfile";
            this.pnlProfile.Size = new Size(390, 380);
            this.pnlProfile.TabIndex = 1;
            this.pnlTop.Controls.Add(this.lbMobileNo);
            this.pnlTop.Controls.Add(this.lbSid);
            this.pnlContainer.BackColor = Color.Transparent;
            this.pnlContainer.Controls.Add(this.lbOptionItems);
            this.pnlContainer.Controls.Add(this.label1);
            this.pnlContainer.Controls.Add(this.pnlProfile);
            this.pnlContainer.Controls.Add(this.btnCancel);
            this.pnlContainer.Controls.Add(this.btnConfirm);
            this.pnlContainer.Controls.Add(this.pnlTop);
            this.pnlContainer.Dock = DockStyle.Fill;
            this.pnlContainer.Location = new Point(3, 3);
            this.pnlContainer.Name = "pnlContainer";
            this.pnlContainer.Size = new Size(0x210, 0x1c3);
            this.pnlContainer.TabIndex = 2;
            this.label1.BorderStyle = BorderStyle.Fixed3D;
            this.label1.Location = new Point(4, 410);
            this.label1.Name = "label1";
            this.label1.Size = new Size(510, 1);
            this.label1.TabIndex = 2;
            this.lbOptionItems.drawer = this.m_headicon_list_drawer;
            this.m_headicon_list_drawer.stretch_textarea = true;
            this.m_headicon_list_drawer.show_focus = false;
            this.lbOptionItems.FormattingEnabled = true;
            this.lbOptionItems.Location = new Point(3, 3);
            this.lbOptionItems.Name = "lbOptionItems";
            this.lbOptionItems.Size = new Size(120, 400);
            this.lbOptionItems.TabIndex = 5;
            base.AcceptButton = this.btnConfirm;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.CancelButton = this.btnCancel;
            base.ClientSize = new Size(0x216, 0x1c9);
            base.Controls.Add(this.pnlContainer);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.MinimizeBox = false;
            base.Name = "InitProfile";
            base.Padding = new Padding(3);
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterParent;
            base.Controls.SetChildIndex(this.pnlContainer, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            this.pnlTop.ResumeLayout(false);
            this.pnlContainer.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void lbOptionItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.LoadControl(this.lbOptionItems.SelectedIndex);
        }

        private void lbOptionItems_SelectedIndexChanging(object sender, listbox_widget.cancel_select_event_args args)
        {
            if (!this._curControl.GetValidData())
            {
                args.Cancel = true;
            }
        }

        private void LoadControl(ProfileControlBase c)
        {
            this._curControl = c;
            base.SuspendLayout();
            this.pnlProfile.Controls.Clear();
            c.Dock = DockStyle.Fill;
            this.pnlProfile.Controls.Add(c);
            base.ResumeLayout();
        }

        private void LoadControl(int index)
        {
            if ((index >= 0) && (index < this.controls.Length))
            {
                this.LoadControl(this.controls[index]);
            }
        }

        private void LoadResource()
        {
        }
    }
}

⌨️ 快捷键说明

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