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

📄 initbasicprofile.cs

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

    public class InitBasicProfile : ProfileControlBase
    {
        private IContainer components;
        private XLabel lblBasicInfo;
        private XLabel lblName_Nav;
        private XLabel lblNickName_Nav;
        private XLabel lblNotes_Nav;
        private XLabel lblSeperate;
        private XLabel lblSex_Nav;
        private Panel panel1;
        private RadioButton rbBoy;
        private RadioButton rbGirl;
        private TextBox txtName;
        private TextBox txtNickName;
        private TextBox txtNotes;

        public InitBasicProfile(ProvsionData pdata) : base(pdata)
        {
            this.InitializeComponent();
            this.LoadResource();
            this.Init();
        }

        private bool CheckData()
        {
            if (this.txtNickName.Text.Trim() == "")
            {
                BalloonHelper.ShowBallon(this.txtNickName, "请填写昵称!", "请注意!", ToolTipIcon.Error, 0x3e8);
                return false;
            }
            if (!ContentFilter.Instance.IsValidNickName(this.txtNickName.Text))
            {
                BalloonHelper.ShowBallon(this.txtNickName, string.Format("昵称不能为{0}!", this.txtNickName.Text), "错误!", 0x3e8);
                return false;
            }
            return true;
        }

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

        public override bool GetValidData()
        {
            if (!this.CheckData())
            {
                return false;
            }
            base._pdata.ProvsionUserInfo.Name.ProposedValue = this.txtName.Text;
            base._pdata.ProvsionUserInfo.NickName.ProposedValue = this.txtNickName.Text;
            if (this.rbBoy.Checked)
            {
                base._pdata.ProvsionUserInfo.Gender.ProposedValue = Gender.Male;
            }
            if (this.rbGirl.Checked)
            {
                base._pdata.ProvsionUserInfo.Gender.ProposedValue = Gender.Female;
            }
            base._pdata.ProvsionUserInfo.Notes.ProposedValue = this.txtNotes.Text;
            return true;
        }

        private void Init()
        {
            if (base._pdata != null)
            {
                this.txtName.Text = (string) base._pdata.ProvsionUserInfo.Name;
                this.txtNickName.Text = (string) base._pdata.ProvsionUserInfo.NickName;
                this.rbBoy.Checked = base._pdata.ProvsionUserInfo.Gender == 1;
                this.rbGirl.Checked = base._pdata.ProvsionUserInfo.Gender == 2;
                this.txtNotes.Text = (string) base._pdata.ProvsionUserInfo.Notes;
            }
            ControlHelper.ForceControlImeHangul(this.txtName);
            ControlHelper.ForceControlImeHangul(this.txtNickName);
        }

        private void InitializeComponent()
        {
            this.lblBasicInfo = new XLabel();
            this.lblSeperate = new XLabel();
            this.lblNickName_Nav = new XLabel();
            this.txtNickName = new TextBox();
            this.lblName_Nav = new XLabel();
            this.txtName = new TextBox();
            this.lblSex_Nav = new XLabel();
            this.lblNotes_Nav = new XLabel();
            this.txtNotes = new TextBox();
            this.panel1 = new Panel();
            this.rbGirl = new RadioButton();
            this.rbBoy = new RadioButton();
            this.panel1.SuspendLayout();
            base.SuspendLayout();
            this.lblBasicInfo.AutoEllipsis = false;
            this.lblBasicInfo.AutoSize = true;
            this.lblBasicInfo.BorderColor = Color.Black;
            this.lblBasicInfo.BorderStyle = BorderStyle.None;
            this.lblBasicInfo.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblBasicInfo.Location = new Point(5, 11);
            this.lblBasicInfo.Name = "lblBasicInfo";
            this.lblBasicInfo.Size = new Size(0x39, 13);
            this.lblBasicInfo.TabIndex = 0;
            this.lblBasicInfo.Text = "基本资料";
            this.lblBasicInfo.TextAlign = ContentAlignment.TopLeft;
            this.lblBasicInfo.UseMnemonic = false;
            this.lblSeperate.AutoEllipsis = false;
            this.lblSeperate.BorderColor = Color.Black;
            this.lblSeperate.BorderStyle = BorderStyle.Fixed3D;
            this.lblSeperate.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblSeperate.Location = new Point(0x44, 0x10);
            this.lblSeperate.Name = "lblSeperate";
            this.lblSeperate.Size = new Size(300, 2);
            this.lblSeperate.TabIndex = 1;
            this.lblSeperate.TextAlign = ContentAlignment.TopLeft;
            this.lblSeperate.UseMnemonic = false;
            this.lblNickName_Nav.AutoEllipsis = false;
            this.lblNickName_Nav.AutoSize = true;
            this.lblNickName_Nav.BorderColor = Color.Black;
            this.lblNickName_Nav.BorderStyle = BorderStyle.None;
            this.lblNickName_Nav.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblNickName_Nav.Location = new Point(0x10, 0x25);
            this.lblNickName_Nav.Name = "lblNickName_Nav";
            this.lblNickName_Nav.Size = new Size(0x3f, 13);
            this.lblNickName_Nav.TabIndex = 2;
            this.lblNickName_Nav.Text = "昵      称:";
            this.lblNickName_Nav.TextAlign = ContentAlignment.TopLeft;
            this.lblNickName_Nav.UseMnemonic = false;
            this.txtNickName.Location = new Point(0x5c, 0x22);
            this.txtNickName.MaxLength = 15;
            this.txtNickName.Name = "txtNickName";
            this.txtNickName.Size = new Size(0x88, 20);
            this.txtNickName.TabIndex = 3;
            this.lblName_Nav.AutoEllipsis = false;
            this.lblName_Nav.AutoSize = true;
            this.lblName_Nav.BorderColor = Color.Black;
            this.lblName_Nav.BorderStyle = BorderStyle.None;
            this.lblName_Nav.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblName_Nav.Location = new Point(0x10, 0x42);
            this.lblName_Nav.Name = "lblName_Nav";
            this.lblName_Nav.Size = new Size(0x3f, 13);
            this.lblName_Nav.TabIndex = 4;
            this.lblName_Nav.Text = "姓      名:";
            this.lblName_Nav.TextAlign = ContentAlignment.TopLeft;
            this.lblName_Nav.UseMnemonic = false;
            this.txtName.Location = new Point(0x5c, 0x3f);
            this.txtName.MaxLength = 0x40;
            this.txtName.Name = "txtName";
            this.txtName.Size = new Size(0x88, 20);
            this.txtName.TabIndex = 5;
            this.lblSex_Nav.AutoEllipsis = false;
            this.lblSex_Nav.AutoSize = true;
            this.lblSex_Nav.BorderColor = Color.Black;
            this.lblSex_Nav.BorderStyle = BorderStyle.None;
            this.lblSex_Nav.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblSex_Nav.Location = new Point(0x10, 0x62);
            this.lblSex_Nav.Name = "lblSex_Nav";
            this.lblSex_Nav.Size = new Size(0x3f, 13);
            this.lblSex_Nav.TabIndex = 6;
            this.lblSex_Nav.Text = "性      别:";
            this.lblSex_Nav.TextAlign = ContentAlignment.TopLeft;
            this.lblSex_Nav.UseMnemonic = false;
            this.lblNotes_Nav.AutoEllipsis = false;
            this.lblNotes_Nav.AutoSize = true;
            this.lblNotes_Nav.BorderColor = Color.Black;
            this.lblNotes_Nav.BorderStyle = BorderStyle.None;
            this.lblNotes_Nav.ButtonBorderStyle = ButtonBorderStyle.Solid;
            this.lblNotes_Nav.Location = new Point(0x10, 0x80);
            this.lblNotes_Nav.Name = "lblNotes_Nav";
            this.lblNotes_Nav.Size = new Size(0x45, 13);
            this.lblNotes_Nav.TabIndex = 8;
            this.lblNotes_Nav.Text = "个人简介:";
            this.lblNotes_Nav.TextAlign = ContentAlignment.TopLeft;
            this.lblNotes_Nav.UseMnemonic = false;
            this.lblNotes_Nav.Visible = false;
            this.txtNotes.Location = new Point(0x5c, 0x80);
            this.txtNotes.MaxLength = 0x100;
            this.txtNotes.Multiline = true;
            this.txtNotes.Name = "txtNotes";
            this.txtNotes.Size = new Size(0xf1, 0x73);
            this.txtNotes.TabIndex = 9;
            this.txtNotes.Visible = false;
            this.panel1.Controls.Add(this.rbGirl);
            this.panel1.Controls.Add(this.rbBoy);
            this.panel1.Location = new Point(0x5c, 0x5d);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x88, 0x1b);
            this.panel1.TabIndex = 7;
            this.rbGirl.AutoSize = true;
            this.rbGirl.Checked = true;
            this.rbGirl.Location = new Point(0x3e, 2);
            this.rbGirl.Name = "rbGirl";
            this.rbGirl.Size = new Size(0x25, 0x11);
            this.rbGirl.TabIndex = 1;
            this.rbGirl.TabStop = true;
            this.rbGirl.Text = "女";
            this.rbGirl.UseVisualStyleBackColor = true;
            this.rbBoy.AutoSize = true;
            this.rbBoy.Location = new Point(4, 2);
            this.rbBoy.Name = "rbBoy";
            this.rbBoy.Size = new Size(0x25, 0x11);
            this.rbBoy.TabIndex = 0;
            this.rbBoy.Text = "男";
            this.rbBoy.UseVisualStyleBackColor = true;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            this.BackColor = Color.Transparent;
            base.Controls.Add(this.panel1);
            base.Controls.Add(this.txtNotes);
            base.Controls.Add(this.txtName);
            base.Controls.Add(this.txtNickName);
            base.Controls.Add(this.lblNotes_Nav);
            base.Controls.Add(this.lblSex_Nav);
            base.Controls.Add(this.lblName_Nav);
            base.Controls.Add(this.lblNickName_Nav);
            base.Controls.Add(this.lblBasicInfo);
            base.Controls.Add(this.lblSeperate);
            base.Name = "InitBasicProfile";
            base.Size = new Size(360, 400);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void LoadResource()
        {
        }

        public override int ID
        {
            get
            {
                return 0;
            }
        }
    }
}

⌨️ 快捷键说明

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