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

📄 promptliveupdate.cs

📁 飞信的收发使用csharp进行开发
💻 CS
字号:
namespace Imps.Client.Pc
{
    using Imps.Client;
    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 PromptLiveUpdate : XIMDialog
    {
        private IFrameworkWindow _mainWnd;
        private UpdateInfo _updateInfo;
        private XButton btnUpdateLater;
        private XButton btnUpdateNow;
        private IContainer components;
        private ListBox lbDetails;
        private LinkLabel llDownloadURL;
        private HtmlLabel lMessage;
        private Panel panel1;
        private PictureBox pbInfomation;

        internal PromptLiveUpdate(UpdateInfo updateInfo, IFrameworkWindow mainWnd)
        {
            this.InitializeComponent();
            this._mainWnd = mainWnd;
            this._updateInfo = updateInfo;
            this.pbInfomation.Image = ImpsResources.GetImage("Images.Update.png");
            foreach (string str in updateInfo.Details)
            {
                this.lbDetails.Items.Add(str);
            }
            if ((updateInfo.Type == UpdateType.force) && (mainWnd.AccountManager.CurrentUser.Status != UserAccountStatus.Logon))
            {
                this.btnUpdateNow.Text = "立即下载安装更新";
                this.btnUpdateLater.Text = "退出Fetion";
                base.Text = "您需要升级您的飞信才可以继续使用";
                this.lMessage.Text = "您可以选择现在下载并安装更新,在此期间飞信会退出;\r\n您也可以退出飞信并到<a href=\"http://www.fetion.com.cn\">飞信首页</a>下载最新的安装包完成升级。\r\n\r\n我们对此次升级给您造成的不便深感歉意,感谢您对飞信的支持!";
            }
            else
            {
                this.btnUpdateNow.Text = "立即下载安装更新";
                this.btnUpdateLater.Text = "以后再提醒我";
                base.Text = "有新版本的飞信可以升级";
                this.lMessage.Text = "您可以选择现在下载并安装更新,在此期间飞信会退出。\r\n您也可以到<a href=\"http://www.fetion.com.cn\">飞信首页</a>下载最新的安装包完成升级。\r\n\r\n我们对此次升级给您造成的不便深感歉意,感谢您对飞信的支持!";
            }
        }

        private void btnUpdateLater_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnUpdateNow_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(PromptLiveUpdate));
            this.btnUpdateNow = new XButton();
            this.btnUpdateLater = new XButton();
            this.pbInfomation = new PictureBox();
            this.llDownloadURL = new LinkLabel();
            this.lbDetails = new ListBox();
            this.panel1 = new Panel();
            this.lMessage = new HtmlLabel();
            ((ISupportInitialize) this.pbInfomation).BeginInit();
            this.panel1.SuspendLayout();
            base.SuspendLayout();
            this.btnUpdateNow.DialogResult = DialogResult.Yes;
            this.btnUpdateNow.Location = new Point(0xd3, 0x114);
            this.btnUpdateNow.Name = "btnUpdateNow";
            this.btnUpdateNow.Size = new Size(0xa2, 0x17);
            this.btnUpdateNow.TabIndex = 0;
            this.btnUpdateNow.UseVisualStyleBackColor = true;
            this.btnUpdateNow.Click += new EventHandler(this.btnUpdateNow_Click);
            this.btnUpdateLater.DialogResult = DialogResult.No;
            this.btnUpdateLater.Location = new Point(0x17b, 0x114);
            this.btnUpdateLater.Name = "btnUpdateLater";
            this.btnUpdateLater.Size = new Size(0xa2, 0x17);
            this.btnUpdateLater.TabIndex = 1;
            this.btnUpdateLater.UseVisualStyleBackColor = true;
            this.btnUpdateLater.Click += new EventHandler(this.btnUpdateLater_Click);
            this.pbInfomation.BorderStyle = BorderStyle.FixedSingle;
            this.pbInfomation.Location = new Point(12, 0x15);
            this.pbInfomation.Name = "pbInfomation";
            this.pbInfomation.Size = new Size(0x38, 0x38);
            this.pbInfomation.TabIndex = 2;
            this.pbInfomation.TabStop = false;
            this.llDownloadURL.AutoSize = true;
            this.llDownloadURL.Location = new Point(14, 0x119);
            this.llDownloadURL.Name = "llDownloadURL";
            this.llDownloadURL.Size = new Size(0x81, 13);
            this.llDownloadURL.TabIndex = 4;
            this.llDownloadURL.TabStop = true;
            this.llDownloadURL.Text = "http://www.fetion.com.cn";
            this.llDownloadURL.LinkClicked += new LinkLabelLinkClickedEventHandler(this.llDownloadURL_LinkClicked);
            this.lbDetails.FormattingEnabled = true;
            this.lbDetails.Location = new Point(12, 0x6b);
            this.lbDetails.Name = "lbDetails";
            this.lbDetails.Size = new Size(0x211, 160);
            this.lbDetails.TabIndex = 5;
            this.panel1.BackColor = Color.Transparent;
            this.panel1.Controls.Add(this.lMessage);
            this.panel1.Controls.Add(this.pbInfomation);
            this.panel1.Controls.Add(this.lbDetails);
            this.panel1.Controls.Add(this.btnUpdateNow);
            this.panel1.Controls.Add(this.llDownloadURL);
            this.panel1.Controls.Add(this.btnUpdateLater);
            this.panel1.Dock = DockStyle.Fill;
            this.panel1.Location = new Point(6, 0x19);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x235, 0x151);
            this.panel1.TabIndex = 6;
            this.lMessage.LinkColor = Color.Blue;
            this.lMessage.Location = new Point(0x4a, 0x15);
            this.lMessage.Name = "lMessage";
            this.lMessage.Size = new Size(0x1d3, 0x53);
            this.lMessage.TabIndex = 6;
            this.lMessage.LabelLinkClick += new EventHandler<LabelLinkClickEventArgs>(this.lMessage_LabelLinkClick);
            base.AcceptButton = this.btnUpdateNow;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.CancelButton = this.btnUpdateLater;
            base.ClientSize = new Size(590, 370);
            base.Controls.Add(this.panel1);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.Name = "PromptLiveUpdate";
            base.Padding = new Padding(6, 0x19, 0x13, 8);
            base.StartPosition = FormStartPosition.CenterParent;
            base.Text = "有新版本的飞信可以升级";
            base.Controls.SetChildIndex(this.panel1, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            ((ISupportInitialize) this.pbInfomation).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            base.ResumeLayout(false);
        }

        private void llDownloadURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ShellHelper.StartUrl("http://www.fetion.com.cn");
        }

        private void lMessage_LabelLinkClick(object sender, LabelLinkClickEventArgs e)
        {
            ShellHelper.StartUrl(e.Url);
        }

        internal DialogResult ShowUpdate()
        {
            if ((this._updateInfo.Type != UpdateType.force) || (this._mainWnd.AccountManager.CurrentUser.Status == UserAccountStatus.Logon))
            {
                return base.ShowDialog();
            }
            if (base.ShowDialog() == DialogResult.No)
            {
                Application.Exit();
            }
            return DialogResult.Yes;
        }
    }
}

⌨️ 快捷键说明

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