📄 promptliveupdate.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client;
using Imps.Client.Pc.BizControls;
using Imps.Client.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
public class PromptLiveUpdate : Form
{
private IFrameworkWindow _mainWnd;
private UpdateInfo _updateInfo;
private Button btnUpdateLater;
private Button btnUpdateNow;
private IContainer components;
private LinkLabel llDownloadURL;
private HtmlLabel lMessage;
private Panel panel1;
private PictureBox pbInfomation;
private RichTextBox rtDetail;
internal PromptLiveUpdate(UpdateInfo updateInfo, IFrameworkWindow mainWnd)
{
this.InitializeComponent();
this._mainWnd = mainWnd;
this._updateInfo = updateInfo;
this.pbInfomation.Image = ImpsResources.GetImage("Images.Update.png");
StringBuilder builder = new StringBuilder();
foreach (string text in updateInfo.Details)
{
builder.AppendLine(text);
}
this.rtDetail.Text = builder.ToString();
if ((updateInfo.Type == UpdateType.force) && (mainWnd.AccountManager.CurrentUser.Status != UserAccountStatus.Logon))
{
this.btnUpdateNow.Text = "立即下载安装更新";
this.btnUpdateLater.Text = "退出Fetion";
this.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 = "以后再提醒我";
this.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()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(PromptLiveUpdate));
this.btnUpdateNow = new Button();
this.btnUpdateLater = new Button();
this.llDownloadURL = new LinkLabel();
this.panel1 = new Panel();
this.rtDetail = new RichTextBox();
this.lMessage = new HtmlLabel();
this.pbInfomation = new PictureBox();
this.panel1.SuspendLayout();
this.pbInfomation.BeginInit();
base.SuspendLayout();
this.btnUpdateNow.BackColor = Color.Transparent;
this.btnUpdateNow.DialogResult = DialogResult.Yes;
this.btnUpdateNow.Location = new System.Drawing.Point(0xd3, 0xff);
this.btnUpdateNow.Name = "btnUpdateNow";
this.btnUpdateNow.Size = new Size(0xa2, 0x15);
this.btnUpdateNow.TabIndex = 0;
this.btnUpdateNow.set_UseVisualStyleBackColor(false);
this.btnUpdateNow.Click += new EventHandler(this.btnUpdateNow_Click);
this.btnUpdateLater.BackColor = Color.Transparent;
this.btnUpdateLater.DialogResult = DialogResult.No;
this.btnUpdateLater.Location = new System.Drawing.Point(0x17b, 0xff);
this.btnUpdateLater.Name = "btnUpdateLater";
this.btnUpdateLater.Size = new Size(0xa2, 0x15);
this.btnUpdateLater.TabIndex = 1;
this.btnUpdateLater.set_UseVisualStyleBackColor(false);
this.btnUpdateLater.Click += new EventHandler(this.btnUpdateLater_Click);
this.llDownloadURL.set_AutoSize(true);
this.llDownloadURL.Location = new System.Drawing.Point(14, 0x103);
this.llDownloadURL.Name = "llDownloadURL";
this.llDownloadURL.Size = new Size(0x95, 12);
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.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.rtDetail);
this.panel1.Controls.Add(this.lMessage);
this.panel1.Controls.Add(this.pbInfomation);
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 System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x229, 0x11f);
this.panel1.TabIndex = 6;
this.rtDetail.BorderStyle = BorderStyle.FixedSingle;
this.rtDetail.Location = new System.Drawing.Point(12, 0x65);
this.rtDetail.Name = "rtDetail";
this.rtDetail.ReadOnly = true;
this.rtDetail.Size = new Size(0x211, 0x94);
this.rtDetail.TabIndex = 7;
this.rtDetail.Text = "";
this.lMessage.LinkColor = Color.Blue;
this.lMessage.Location = new System.Drawing.Point(0x4a, 0x13);
this.lMessage.Name = "lMessage";
this.lMessage.ShowBackgroundImage = false;
this.lMessage.Size = new Size(0x1d3, 0x4d);
this.lMessage.TabIndex = 6;
this.lMessage.LabelLinkClick += new EventHandler<LabelLinkClickEventArgs>(this, (IntPtr) this.lMessage_LabelLinkClick);
this.pbInfomation.BorderStyle = BorderStyle.FixedSingle;
this.pbInfomation.Location = new System.Drawing.Point(12, 0x13);
this.pbInfomation.Name = "pbInfomation";
this.pbInfomation.Size = new Size(0x38, 0x38);
this.pbInfomation.TabIndex = 2;
this.pbInfomation.TabStop = false;
base.AcceptButton = this.btnUpdateNow;
base.set_AutoScaleDimensions(new SizeF(6f, 12f));
base.set_AutoScaleMode(1);
base.CancelButton = this.btnUpdateLater;
base.ClientSize = new Size(0x229, 0x11f);
base.Controls.Add(this.panel1);
base.FormBorderStyle = FormBorderStyle.FixedDialog;
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "PromptLiveUpdate";
base.StartPosition = FormStartPosition.CenterParent;
this.Text = "有新版本的飞信可以升级";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.pbInfomation.EndInit();
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.Yes)
{
ShellHelper.ApplicationExit();
return DialogResult.No;
}
return DialogResult.Yes;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -