📄 psprivacycontrol.cs
字号:
namespace Imps.Client.Pc.Options
{
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.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PsPrivacyControl : OptionsControlBase
{
private IFrameworkWindow _iFrameworkWindow;
private IContainer components;
private XLabel label1;
private XLabel label2;
private XLabel label3;
private XLabel lbCompanyName;
private XLabel lbCompanyWebSite;
private XLabel lbHomePhone;
private XLabel lbJobTitle;
private XLabel lbWorkPhone;
private MobileEmailLinkControl linkBindMobilEmail;
private XTextBox textBoxCompanyName;
private XTextBox textBoxCompanyWebSite;
private XTextBox textBoxEmail;
private XTextBox textBoxJobTitle;
private XTextBox textBoxPhone;
private XComboBox xcbPerBiz;
private XComboBox xcbPerEmail;
private XComboBox xcbPerPhone;
private GroupBox xgbBizInfo;
private GroupBox xgbIdentity;
private GroupBox xgbPhone;
private XTextBox xtbMobileNo;
private XTextBox xtbMobileRC;
private XTextBox xtbName;
public PsPrivacyControl(IFrameworkWindow frameworkWnd)
{
this._iFrameworkWindow = frameworkWnd;
this.InitializeComponent();
this.SetLimitation();
this.initPermission();
this.handleUiEvent();
this.linkBindMobilEmail.Init(frameworkWnd);
}
public PsPrivacyControl(IFrameworkWindow frameworkWnd, bool showPer) : this(frameworkWnd)
{
if (!showPer)
{
this.xcbPerBiz.Visible = false;
this.xcbPerEmail.Visible = false;
this.xcbPerPhone.Visible = false;
}
}
public override bool CheckUserInput()
{
if (!this.DoCheckEmail(this.textBoxEmail))
{
return false;
}
if (!this.DoCheckPhone(this.textBoxPhone))
{
return false;
}
return true;
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private bool DoCheckEmail(TextBox txtControl)
{
if ((txtControl.Text.Trim() != "") && !StringHelper.IsEmail(txtControl.Text))
{
txtControl.Focus();
txtControl.SelectAll();
BalloonHelper.ShowInputErrorBallon(txtControl, "电子邮件地址不正确!", "错误!", 0x5dc);
return false;
}
return true;
}
private bool DoCheckPhone(Control inputCtrl)
{
if (!StringHelper.IsAscii(inputCtrl.Text.Trim()))
{
BalloonHelper.ShowInputErrorBallon(inputCtrl, StringTable.MsgAsciiOnly, StringTable.Options.TitleInvalidInput);
return false;
}
return true;
}
private void handleUiEvent()
{
this.xtbName.TextChanged += new EventHandler(this.uiData_Changed);
this.xcbPerBiz.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.textBoxCompanyName.TextChanged += new EventHandler(this.uiData_Changed);
this.textBoxCompanyWebSite.TextChanged += new EventHandler(this.uiData_Changed);
this.textBoxJobTitle.TextChanged += new EventHandler(this.uiData_Changed);
this.xcbPerPhone.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.textBoxEmail.TextChanged += new EventHandler(this.uiData_Changed);
this.xcbPerPhone.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.xcbPerEmail.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.textBoxPhone.TextChanged += new EventHandler(this.uiData_Changed);
this.linkBindMobilEmail.BindInfoChanged += new EventHandler(this.linkBindMobilEmail_BindInfoChanged);
}
private void InitializeComponent()
{
this.xgbIdentity = new GroupBox();
this.label3 = new XLabel();
this.xtbMobileNo = new XTextBox();
this.xtbMobileRC = new XTextBox();
this.xtbName = new XTextBox();
this.label2 = new XLabel();
this.label1 = new XLabel();
this.xgbPhone = new GroupBox();
this.linkBindMobilEmail = new MobileEmailLinkControl();
this.xcbPerEmail = new XComboBox();
this.xcbPerPhone = new XComboBox();
this.lbHomePhone = new XLabel();
this.textBoxEmail = new XTextBox();
this.lbWorkPhone = new XLabel();
this.textBoxPhone = new XTextBox();
this.xgbBizInfo = new GroupBox();
this.textBoxJobTitle = new XTextBox();
this.textBoxCompanyWebSite = new XTextBox();
this.textBoxCompanyName = new XTextBox();
this.lbJobTitle = new XLabel();
this.lbCompanyWebSite = new XLabel();
this.lbCompanyName = new XLabel();
this.xcbPerBiz = new XComboBox();
this.xgbIdentity.SuspendLayout();
this.xgbPhone.SuspendLayout();
this.xgbBizInfo.SuspendLayout();
base.SuspendLayout();
this.xgbIdentity.Controls.Add(this.label3);
this.xgbIdentity.Controls.Add(this.xtbMobileNo);
this.xgbIdentity.Controls.Add(this.xtbMobileRC);
this.xgbIdentity.Controls.Add(this.xtbName);
this.xgbIdentity.Controls.Add(this.label2);
this.xgbIdentity.Controls.Add(this.label1);
this.xgbIdentity.Location = new System.Drawing.Point(5, 8);
this.xgbIdentity.Name = "xgbIdentity";
this.xgbIdentity.Size = new Size(0x19c, 0x53);
this.xgbIdentity.TabIndex = 0;
this.xgbIdentity.TabStop = false;
this.xgbIdentity.Text = "真实信息";
this.label3.BackColor = SystemColors.get_ButtonFace();
this.label3.BorderColor = Color.Empty;
this.label3.BorderStyle = BorderStyle.FixedSingle;
this.label3.ButtonBorderStyle = ButtonBorderStyle.None;
this.label3.Location = new System.Drawing.Point(0x11d, 0);
this.label3.Name = "label3";
this.label3.Size = new Size(120, 0x10);
this.label3.TabIndex = 0;
this.label3.Text = "保密";
this.label3.TextAlign = ContentAlignment.MiddleCenter;
this.xtbMobileNo.BackColor = Color.FromArgb(240, 240, 240);
this.xtbMobileNo.BorderStyle = BorderStyle.FixedSingle;
this.xtbMobileNo.EmptyTextTip = "";
this.xtbMobileNo.EmptyTextTipColor = Color.DarkGray;
this.xtbMobileNo.Location = new System.Drawing.Point(0x83, 50);
this.xtbMobileNo.Name = "xtbMobileNo";
this.xtbMobileNo.ReadOnly = true;
this.xtbMobileNo.Size = new Size(0x7d, 0x15);
this.xtbMobileNo.TabIndex = 2;
this.xtbMobileRC.BackColor = Color.FromArgb(240, 240, 240);
this.xtbMobileRC.BorderStyle = BorderStyle.FixedSingle;
this.xtbMobileRC.EmptyTextTip = "";
this.xtbMobileRC.EmptyTextTipColor = Color.DarkGray;
this.xtbMobileRC.Location = new System.Drawing.Point(0x51, 50);
this.xtbMobileRC.Name = "xtbMobileRC";
this.xtbMobileRC.ReadOnly = true;
this.xtbMobileRC.Size = new Size(0x2c, 0x15);
this.xtbMobileRC.TabIndex = 1;
this.xtbName.BackColor = Color.White;
this.xtbName.BorderStyle = BorderStyle.FixedSingle;
this.xtbName.EmptyTextTip = "";
this.xtbName.EmptyTextTipColor = Color.DarkGray;
this.xtbName.Location = new System.Drawing.Point(0x51, 0x18);
this.xtbName.MaxLength = 60;
this.xtbName.Name = "xtbName";
this.xtbName.Size = new Size(0xaf, 0x15);
this.xtbName.TabIndex = 0;
this.xtbName.Enter += new EventHandler(this.xtbName_Enter);
this.xtbName.Leave += new EventHandler(this.xtbName_Leave);
this.label2.set_AutoSize(true);
this.label2.BorderColor = Color.Empty;
this.label2.ButtonBorderStyle = ButtonBorderStyle.None;
this.label2.ImageAlign = ContentAlignment.TopRight;
this.label2.Location = new System.Drawing.Point(0x11, 0x34);
this.label2.Name = "label2";
this.label2.Size = new Size(0x3b, 12);
this.label2.TabIndex = 3;
this.label2.Text = "手机号码:";
this.label1.set_AutoSize(true);
this.label1.BorderColor = Color.Empty;
this.label1.ButtonBorderStyle = ButtonBorderStyle.None;
this.label1.ImageAlign = ContentAlignment.TopRight;
this.label1.Location = new System.Drawing.Point(0x29, 0x1a);
this.label1.Name = "label1";
this.label1.Size = new Size(0x23, 12);
this.label1.TabIndex = 1;
this.label1.Text = "姓名:";
this.xgbPhone.Controls.Add(this.linkBindMobilEmail);
this.xgbPhone.Controls.Add(this.xcbPerEmail);
this.xgbPhone.Controls.Add(this.xcbPerPhone);
this.xgbPhone.Controls.Add(this.lbHomePhone);
this.xgbPhone.Controls.Add(this.textBoxEmail);
this.xgbPhone.Controls.Add(this.lbWorkPhone);
this.xgbPhone.Controls.Add(this.textBoxPhone);
this.xgbPhone.Location = new System.Drawing.Point(5, 0xcd);
this.xgbPhone.Name = "xgbPhone";
this.xgbPhone.Size = new Size(0x19c, 100);
this.xgbPhone.TabIndex = 2;
this.xgbPhone.TabStop = false;
this.xgbPhone.Text = "联系方式";
this.linkBindMobilEmail.set_AutoSize(true);
this.linkBindMobilEmail.Location = new System.Drawing.Point(0x11d, 0x4f);
this.linkBindMobilEmail.Name = "linkBindMobilEmail";
this.linkBindMobilEmail.Size = new Size(0x4d, 12);
this.linkBindMobilEmail.TabIndex = 4;
this.linkBindMobilEmail.TabStop = true;
this.linkBindMobilEmail.Text = "绑定手机邮箱";
this.xcbPerEmail.BackColor = Color.White;
this.xcbPerEmail.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbPerEmail.EmptyTextTip = "";
this.xcbPerEmail.EmptyTextTipColor = Color.DarkGray;
this.xcbPerEmail.set_FormattingEnabled(true);
this.xcbPerEmail.Location = new System.Drawing.Point(0x11f, 0x19);
this.xcbPerEmail.Name = "xcbPerEmail";
this.xcbPerEmail.Size = new Size(0x77, 20);
this.xcbPerEmail.TabIndex = 1;
this.xcbPerPhone.BackColor = Color.White;
this.xcbPerPhone.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbPerPhone.EmptyTextTip = "";
this.xcbPerPhone.EmptyTextTipColor = Color.DarkGray;
this.xcbPerPhone.set_FormattingEnabled(true);
this.xcbPerPhone.Location = new System.Drawing.Point(0x11f, 0x34);
this.xcbPerPhone.Name = "xcbPerPhone";
this.xcbPerPhone.Size = new Size(0x77, 20);
this.xcbPerPhone.TabIndex = 3;
this.lbHomePhone.set_AutoSize(true);
this.lbHomePhone.BorderColor = Color.Empty;
this.lbHomePhone.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbHomePhone.ImageAlign = ContentAlignment.TopRight;
this.lbHomePhone.Location = new System.Drawing.Point(0x11, 0x37);
this.lbHomePhone.Name = "lbHomePhone";
this.lbHomePhone.Size = new Size(0x3b, 12);
this.lbHomePhone.TabIndex = 1;
this.lbHomePhone.Text = "电话号码:";
this.textBoxEmail.BackColor = Color.White;
this.textBoxEmail.BorderStyle = BorderStyle.FixedSingle;
this.textBoxEmail.EmptyTextTip = "";
this.textBoxEmail.EmptyTextTipColor = Color.DarkGray;
this.textBoxEmail.Location = new System.Drawing.Point(0x51, 0x1a);
this.textBoxEmail.MaxLength = 40;
this.textBoxEmail.Name = "textBoxEmail";
this.textBoxEmail.Size = new Size(200, 0x15);
this.textBoxEmail.TabIndex = 0;
this.lbWorkPhone.set_AutoSize(true);
this.lbWorkPhone.BorderColor = Color.Empty;
this.lbWorkPhone.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbWorkPhone.ImageAlign = ContentAlignment.TopRight;
this.lbWorkPhone.Location = new System.Drawing.Point(0x11, 0x1c);
this.lbWorkPhone.Name = "lbWorkPhone";
this.lbWorkPhone.Size = new Size(0x3b, 12);
this.lbWorkPhone.TabIndex = 3;
this.lbWorkPhone.Text = "电子邮件:";
this.textBoxPhone.BackColor = Color.White;
this.textBoxPhone.BorderStyle = BorderStyle.FixedSingle;
this.textBoxPhone.EmptyTextTip = "";
this.textBoxPhone.EmptyTextTipColor = Color.DarkGray;
this.textBoxPhone.Location = new System.Drawing.Point(0x51, 0x35);
this.textBoxPhone.MaxLength = 40;
this.textBoxPhone.Name = "textBoxPhone";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -