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

📄 profileformvodafone.cs

📁 破解的飞信源代码
💻 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 Imps.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 System.Drawing.Point(9, 170);
            label.Name = "label7";
            label.Size = new Size(0x197, 2);
            label.TabIndex = 0x1c;
            this.label1.set_AutoSize(true);
            this.label1.BackColor = Color.Transparent;
            this.label1.Location = new System.Drawing.Point(9, 0x1a);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x2b, 13);
            this.label1.TabIndex = 2;
            this.label1.Text = "昵称:";
            this.label2.set_AutoSize(true);
            this.label2.BackColor = Color.Transparent;
            this.label2.Location = new System.Drawing.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.set_AutoSize(true);
            this.label3.BackColor = Color.Transparent;
            this.label3.Location = new System.Drawing.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 System.Drawing.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 System.Drawing.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 System.Drawing.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 System.Drawing.Point(0x146, 0xb1);
            this.buttonOk.Name = "buttonOk";
            this.buttonOk.Size = new Size(0x4b, 0x17);
            this.buttonOk.TabIndex = 0x1d;
            this.buttonOk.Text = "确定";
            this.buttonOk.set_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 System.Drawing.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 System.Drawing.Point(0x11, 0x1c);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x189, 0x89);
            this.panel1.TabIndex = 0x1f;
            base.set_AutoScaleDimensions(new SizeF(6f, 13f));
            base.set_AutoScaleMode(1);
            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.set_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, (IntPtr) 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.MainWindow, this._contact.Uri.Raw);
                base.Close();
            }
            this.pictureBoxProtrait.SizeMode = PortraitSizeMode.Size_96;
            this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) 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 paddingStringEndEllipsis = StringHelper.GetPaddingStringEndEllipsis(this._contact.DisplayName, 13);
            base.Text = string.Format("{0} - 个人资料", paddingStringEndEllipsis);
            this.labelMobileNo.Text = this._contact.PersonalInfo.MobileNo;
            this.labelNickname.Text = this._contact.DisplayName;
            this.labelID.Text = (this._contact.Uri.Sid != 0) ? 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 + -