?? promptliveupdate.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 = "您需要升級您的飛信才可以繼續(xù)使用";
this.lMessage.Text = "您可以選擇現(xiàn)在下載并安裝更新,在此期間飛信會退出;\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 = "您可以選擇現(xiàn)在下載并安裝更新,在此期間飛信會退出。\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;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -