📄 extendinfocontrol.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.Resource;
using Imps.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class ExtendInfoControl : ProfileControlBase
{
private Imps.Client.Core.Contact _contact;
private IFrameworkWindow _iFrameworkWindow;
private IContainer components;
private GroupBox groupBox1;
private GroupBox groupBox2;
private GroupBox groupBox3;
private XLabel lblCompany;
private XLabel lblCompanyWebsite;
private XLabel lblJobTitle;
private XComboBox xcbBloodType;
private DateTimeSelectControl xctlBirthdate;
private XLabel xLabel1;
private XLabel xLabel2;
private XLabel xLabel3;
private XLabel xLabel4;
private XLabel xLabel5;
private XLabel xLabel6;
private XLabel xLabel7;
private XTextBox xtbAge;
private XTextBox xtbCompany;
private XTextBox xtbCompanyWebsite;
private XTextBox xtbEmail;
private XTextBox xtbHoroscope;
private XTextBox xtbJobTitle;
private XTextBox xtbLunarA;
private XTextBox xtbPhone;
public ExtendInfoControl(IFrameworkWindow frameworkWnd, Imps.Client.Core.Contact contact)
{
this.InitializeComponent();
this._iFrameworkWindow = frameworkWnd;
this._contact = contact;
this.InitBloodType();
}
private void BusinessProfileControl_Load(object sender, EventArgs e)
{
this.xctlBirthdate.Enabled = false;
this.xcbBloodType.Enabled = false;
this.xtbAge.Enabled = false;
}
public override bool ControlLoad()
{
this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.PersonalInfo_PropertiesChanged);
return base.ControlLoad();
}
public override bool ControlUnload()
{
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.PersonalInfo_PropertiesChanged);
return base.ControlUnload();
}
private void ctlDateTime_DateTimeChange(object sender, EventArgs e)
{
this.FormatHoroscopeAndLunarAnimal();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void FormatHoroscopeAndLunarAnimal()
{
UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
DateTime? selectedDateTime = this.xctlBirthdate.SelectedDateTime;
if (selectedDateTime.get_HasValue())
{
string sHoroscope;
ChineseCalendar calendar = new ChineseCalendar(selectedDateTime.get_Value());
if ((selectedDateTime.get_Value() < calendar.MaxSupportedDateTime) && (selectedDateTime.get_Value() > calendar.MinSupportedDateTime))
{
this.xtbLunarA.Text = calendar.LunarAnimal;
}
calendar.FormatHoroscope(out sHoroscope);
this.xtbHoroscope.Text = sHoroscope;
}
else
{
this.xtbHoroscope.Text = IMPSEnums.GetEnumDescription<Horoscope>(this._contact.PersonalInfo.Horoscope);
this.xtbLunarA.Text = IMPSEnums.GetEnumDescription<LunarAnimal>(this._contact.PersonalInfo.LunarAnimal);
}
});
}
private void InitBloodType()
{
this.xcbBloodType.DataSource = IMPSEnums.GetEnumDescriptionList<BloodType>();
this.xcbBloodType.DisplayMember = "Description";
this.xcbBloodType.ValueMember = "Value";
}
private void InitializeComponent()
{
this.lblCompany = new XLabel();
this.xtbCompany = new XTextBox();
this.lblCompanyWebsite = new XLabel();
this.xtbCompanyWebsite = new XTextBox();
this.lblJobTitle = new XLabel();
this.xtbJobTitle = new XTextBox();
this.groupBox1 = new GroupBox();
this.xtbHoroscope = new XTextBox();
this.xtbLunarA = new XTextBox();
this.xcbBloodType = new XComboBox();
this.xtbAge = new XTextBox();
this.xctlBirthdate = new DateTimeSelectControl();
this.xLabel5 = new XLabel();
this.xLabel4 = new XLabel();
this.xLabel3 = new XLabel();
this.xLabel1 = new XLabel();
this.xLabel2 = new XLabel();
this.groupBox2 = new GroupBox();
this.groupBox3 = new GroupBox();
this.xtbPhone = new XTextBox();
this.xtbEmail = new XTextBox();
this.xLabel6 = new XLabel();
this.xLabel7 = new XLabel();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
base.SuspendLayout();
this.lblCompany.set_AutoSize(true);
this.lblCompany.BorderColor = Color.Empty;
this.lblCompany.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblCompany.Location = new System.Drawing.Point(30, 0x1c);
this.lblCompany.Name = "lblCompany";
this.lblCompany.Size = new Size(0x3a, 13);
this.lblCompany.TabIndex = 0x17;
this.lblCompany.Text = "公司名称:";
this.lblCompany.UseMnemonic = false;
this.xtbCompany.BackColor = Color.FromArgb(240, 240, 240);
this.xtbCompany.BorderStyle = BorderStyle.FixedSingle;
this.xtbCompany.EmptyTextTip = "";
this.xtbCompany.EmptyTextTipColor = Color.DarkGray;
this.xtbCompany.Location = new System.Drawing.Point(0x5e, 0x1a);
this.xtbCompany.MaxLength = 0x80;
this.xtbCompany.Name = "xtbCompany";
this.xtbCompany.ReadOnly = true;
this.xtbCompany.Size = new Size(0xee, 20);
this.xtbCompany.TabIndex = 1;
this.lblCompanyWebsite.set_AutoSize(true);
this.lblCompanyWebsite.BorderColor = Color.Empty;
this.lblCompanyWebsite.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblCompanyWebsite.Location = new System.Drawing.Point(30, 0x3a);
this.lblCompanyWebsite.Name = "lblCompanyWebsite";
this.lblCompanyWebsite.Size = new Size(0x3a, 13);
this.lblCompanyWebsite.TabIndex = 0x17;
this.lblCompanyWebsite.Text = "公司主页:";
this.lblCompanyWebsite.UseMnemonic = false;
this.xtbCompanyWebsite.BackColor = Color.FromArgb(240, 240, 240);
this.xtbCompanyWebsite.BorderStyle = BorderStyle.FixedSingle;
this.xtbCompanyWebsite.EmptyTextTip = "";
this.xtbCompanyWebsite.EmptyTextTipColor = Color.DarkGray;
this.xtbCompanyWebsite.Location = new System.Drawing.Point(0x5e, 0x38);
this.xtbCompanyWebsite.MaxLength = 0x80;
this.xtbCompanyWebsite.Name = "xtbCompanyWebsite";
this.xtbCompanyWebsite.ReadOnly = true;
this.xtbCompanyWebsite.Size = new Size(0xee, 20);
this.xtbCompanyWebsite.TabIndex = 2;
this.lblJobTitle.set_AutoSize(true);
this.lblJobTitle.BorderColor = Color.Empty;
this.lblJobTitle.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblJobTitle.Location = new System.Drawing.Point(0x36, 0x58);
this.lblJobTitle.Name = "lblJobTitle";
this.lblJobTitle.Size = new Size(0x22, 13);
this.lblJobTitle.TabIndex = 0x17;
this.lblJobTitle.Text = "职位:";
this.lblJobTitle.UseMnemonic = false;
this.xtbJobTitle.BackColor = Color.FromArgb(240, 240, 240);
this.xtbJobTitle.BorderStyle = BorderStyle.FixedSingle;
this.xtbJobTitle.EmptyTextTip = "";
this.xtbJobTitle.EmptyTextTipColor = Color.DarkGray;
this.xtbJobTitle.Location = new System.Drawing.Point(0x5e, 0x56);
this.xtbJobTitle.MaxLength = 0x100;
this.xtbJobTitle.Name = "xtbJobTitle";
this.xtbJobTitle.ReadOnly = true;
this.xtbJobTitle.Size = new Size(0xee, 20);
this.xtbJobTitle.TabIndex = 3;
this.groupBox1.Controls.Add(this.xtbHoroscope);
this.groupBox1.Controls.Add(this.xtbLunarA);
this.groupBox1.Controls.Add(this.xcbBloodType);
this.groupBox1.Controls.Add(this.xtbAge);
this.groupBox1.Controls.Add(this.xctlBirthdate);
this.groupBox1.Controls.Add(this.xLabel5);
this.groupBox1.Controls.Add(this.xLabel4);
this.groupBox1.Controls.Add(this.xLabel3);
this.groupBox1.Controls.Add(this.xLabel1);
this.groupBox1.Controls.Add(this.xLabel2);
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(0x16c, 170);
this.groupBox1.TabIndex = 0x18;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "个人信息";
this.xtbHoroscope.BackColor = Color.FromArgb(240, 240, 240);
this.xtbHoroscope.BorderStyle = BorderStyle.FixedSingle;
this.xtbHoroscope.EmptyTextTip = "";
this.xtbHoroscope.EmptyTextTipColor = Color.DarkGray;
this.xtbHoroscope.Location = new System.Drawing.Point(0x5e, 0x8a);
this.xtbHoroscope.Name = "xtbHoroscope";
this.xtbHoroscope.ReadOnly = true;
this.xtbHoroscope.Size = new Size(0x74, 20);
this.xtbHoroscope.TabIndex = 0x1c;
this.xtbLunarA.BackColor = Color.FromArgb(240, 240, 240);
this.xtbLunarA.BorderStyle = BorderStyle.FixedSingle;
this.xtbLunarA.EmptyTextTip = "";
this.xtbLunarA.EmptyTextTipColor = Color.DarkGray;
this.xtbLunarA.Location = new System.Drawing.Point(0x5e, 110);
this.xtbLunarA.Name = "xtbLunarA";
this.xtbLunarA.ReadOnly = true;
this.xtbLunarA.Size = new Size(0x74, 20);
this.xtbLunarA.TabIndex = 0x1b;
this.xcbBloodType.BackColor = Color.White;
this.xcbBloodType.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbBloodType.EmptyTextTip = "";
this.xcbBloodType.EmptyTextTipColor = Color.DarkGray;
this.xcbBloodType.set_FormattingEnabled(true);
this.xcbBloodType.Location = new System.Drawing.Point(0x5e, 80);
this.xcbBloodType.Name = "xcbBloodType";
this.xcbBloodType.Size = new Size(0x74, 0x15);
this.xcbBloodType.TabIndex = 0x1a;
this.xtbAge.BackColor = Color.FromArgb(240, 240, 240);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -