?? profileformvodafone.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 System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class ProfileFormVodafone : XIMDialog
{
private Contact _contact;
private IFrameworkWindow _iFrameworkWindow;
private User _user;
private XButton buttonOk;
private IContainer components;
private XLabel label1;
private XLabel label2;
private XLabel label3;
private XLabel labelID;
private XLabel labelMobileNo;
private XLabel labelNickname;
private Panel panel1;
private DisplayPortrait pictureBoxProtrait;
public ProfileFormVodafone(IFrameworkWindow iFrameworkWnd, Contact contact)
{
this.InitializeComponent();
this._iFrameworkWindow = iFrameworkWnd;
this._contact = contact;
this._user = this._iFrameworkWindow.AccountManager.CurrentUser;
}
private void buttonOk_Click(object sender, EventArgs e)
{
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(ProfileFormVodafone));
this.label1 = new XLabel();
this.label2 = new XLabel();
this.label3 = new XLabel();
this.labelNickname = new XLabel();
this.labelID = new XLabel();
this.labelMobileNo = new XLabel();
this.buttonOk = new XButton();
this.pictureBoxProtrait = new DisplayPortrait();
this.panel1 = new Panel();
XLabel label = new XLabel();
this.panel1.SuspendLayout();
base.SuspendLayout();
label.BorderStyle = BorderStyle.Fixed3D;
label.Location = new Point(9, 170);
label.Name = "label7";
label.Size = new Size(0x197, 2);
label.TabIndex = 0x1c;
this.label1.AutoSize = true;
this.label1.BackColor = Color.Transparent;
this.label1.Location = new Point(9, 0x1a);
this.label1.Name = "label1";
this.label1.Size = new Size(0x2b, 13);
this.label1.TabIndex = 2;
this.label1.Text = "昵稱:";
this.label2.AutoSize = true;
this.label2.BackColor = Color.Transparent;
this.label2.Location = new Point(9, 60);
this.label2.Name = "label2";
this.label2.Size = new Size(0x86, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Vodafone Messenger ID:";
this.label3.AutoSize = true;
this.label3.BackColor = Color.Transparent;
this.label3.Location = new Point(9, 0x5e);
this.label3.Name = "label3";
this.label3.Size = new Size(0x43, 13);
this.label3.TabIndex = 4;
this.label3.Text = "手機號碼:";
this.labelNickname.BackColor = Color.Transparent;
this.labelNickname.Location = new Point(0x3a, 0x1a);
this.labelNickname.Name = "labelNickname";
this.labelNickname.Size = new Size(0xd1, 13);
this.labelNickname.TabIndex = 5;
this.labelNickname.Text = "labelNickname";
this.labelID.BackColor = Color.Transparent;
this.labelID.Location = new Point(0x92, 60);
this.labelID.Name = "labelID";
this.labelID.Size = new Size(0x79, 13);
this.labelID.TabIndex = 6;
this.labelID.Text = "labelID";
this.labelMobileNo.BackColor = Color.Transparent;
this.labelMobileNo.Location = new Point(0x52, 0x5e);
this.labelMobileNo.Name = "labelMobileNo";
this.labelMobileNo.Size = new Size(0xb9, 13);
this.labelMobileNo.TabIndex = 7;
this.labelMobileNo.Text = "labelMobileNo";
this.buttonOk.Location = new Point(0x146, 0xb1);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new Size(0x4b, 0x17);
this.buttonOk.TabIndex = 0x1d;
this.buttonOk.Text = "確定";
this.buttonOk.UseVisualStyleBackColor = true;
this.buttonOk.Click += new EventHandler(this.buttonOk_Click);
this.pictureBoxProtrait.BackColor = Color.Transparent;
this.pictureBoxProtrait.BorderColor = Color.FromArgb(0xa4, 170, 220);
this.pictureBoxProtrait.Cursor = Cursors.Arrow;
this.pictureBoxProtrait.Image = (Image) manager.GetObject("pictureBoxProtrait.Image");
this.pictureBoxProtrait.Location = new Point(0x10d, 15);
this.pictureBoxProtrait.Name = "pictureBoxProtrait";
this.pictureBoxProtrait.Size = new Size(0x76, 0x76);
this.pictureBoxProtrait.TabIndex = 30;
this.pictureBoxProtrait.TabStop = false;
this.pictureBoxProtrait.ToolTipText = "";
this.pictureBoxProtrait.UseHandCursor = false;
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.pictureBoxProtrait);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.labelNickname);
this.panel1.Controls.Add(this.labelID);
this.panel1.Controls.Add(this.labelMobileNo);
this.panel1.Location = new Point(0x11, 0x1c);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x189, 0x89);
this.panel1.TabIndex = 0x1f;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new Size(0x1bb, 0xe9);
base.Controls.Add(this.panel1);
base.Controls.Add(this.buttonOk);
base.Controls.Add(label);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.Name = "ProfileFormVodafone";
base.Padding = new Padding(6, 0x19, 0x13, 8);
base.Text = "ProfileFormVodafone";
base.Load += new EventHandler(this.ProfileFormVodafone_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
base.ResumeLayout(false);
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
try
{
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this.PersonalInfo_PropertiesChanged);
}
catch
{
}
base.OnFormClosed(e);
}
private void PersonalInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
if (e.ContainsAnyOfProperties(new string[] { "MobileNo", "sid", "Portrait" }))
{
this.setUI();
}
}
private void ProfileFormVodafone_Load(object sender, EventArgs e)
{
if (!this._contact.Uri.IsVodafoneUri)
{
this._iFrameworkWindow.ContactManager.ShowContactDetail(this._iFrameworkWindow as Form, this._contact.Uri.Raw);
base.Close();
}
this.pictureBoxProtrait.SizeMode = PortraitSizeMode.Size_96;
this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this.PersonalInfo_PropertiesChanged);
AsyncBizOperation op = new AsyncBizOperation();
this._user.ContactList.AsyncGetContactsInfo(this._contact, op, null, false, new string[] { string.Empty });
this.setUI();
}
private void setUI()
{
string displayName = this._contact.DisplayName;
if (displayName.Length > 13)
{
displayName = displayName.Substring(0, 10) + "...";
}
base.Text = string.Format("{0} - 個人資料", displayName);
this.labelMobileNo.Text = this._contact.PersonalInfo.MobileNo;
this.labelNickname.Text = this._contact.DisplayName;
this.labelID.Text = (this._contact.Uri.Sid != 0L) ? this._contact.Uri.Sid.ToString() : string.Empty;
this.pictureBoxProtrait.Image = this._contact.PersonalInfo.Portrait;
}
public void ShowProfile()
{
this.ShowProfile(null, string.Empty);
}
public void ShowProfile(string name)
{
this.ShowProfile(null, name);
}
public void ShowProfile(IWin32Window owner)
{
this.ShowProfile(owner, string.Empty);
}
public void ShowProfile(IWin32Window owner, string name)
{
if (base.Visible)
{
base.BringToFront();
base.Activate();
}
else
{
if (owner == null)
{
owner = this._iFrameworkWindow.MainWindow;
}
ControlHelper.ShowFormCenterOnParent(this, owner);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -