www.pudn.com > Fetion.rar > ContinueUpdate.cs


namespace Imps.Client.Pc 
{ 
    using Imps.Client; 
    using Imps.Client.Utils; 
    using System; 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
 
    public class ContinueUpdate : Form 
    { 
        private IFrameworkWindow _mainWnd; 
        private UpdateInfo _updateInfo; 
        private Button btnCancel; 
        private Button btnOK; 
        private IContainer components; 
        private Label lMessage; 
        private Label lMessage1; 
        private Panel pnlContainer; 
 
        internal ContinueUpdate(UpdateInfo updateInfo, IFrameworkWindow mainWnd) 
        { 
            this.InitializeComponent(); 
            this.lMessage.Text = "Fetion检测到上次的更新操作还没有完成"; 
            this.lMessage1.Text = "是否继续更新?"; 
            this._mainWnd = mainWnd; 
            this._updateInfo = updateInfo; 
            this.btnOK.Text = "继续更新"; 
            if ((updateInfo.Type == UpdateType.force) && (mainWnd.AccountManager.CurrentUser.Status != UserAccountStatus.Logon)) 
            { 
                this.btnCancel.Text = "退出Fetion"; 
            } 
            else 
            { 
                this.btnCancel.Text = "取消"; 
            } 
        } 
 
        private void btnCancel_Click(object sender, EventArgs e) 
        { 
            base.Close(); 
        } 
 
        private void btnOK_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(ContinueUpdate)); 
            this.lMessage = new Label(); 
            this.btnOK = new Button(); 
            this.btnCancel = new Button(); 
            this.pnlContainer = new Panel(); 
            this.lMessage1 = new Label(); 
            this.pnlContainer.SuspendLayout(); 
            base.SuspendLayout(); 
            this.lMessage.AutoSize = true; 
            this.lMessage.Location = new System.Drawing.Point(12, 0x13); 
            this.lMessage.Name = "lMessage"; 
            this.lMessage.Size = new Size(0xdd, 12); 
            this.lMessage.TabIndex = 0; 
            this.lMessage.Text = "Fetion检测到上次的更新操作还没有完成"; 
            this.btnOK.BackColor = Color.Transparent; 
            this.btnOK.DialogResult = DialogResult.Yes; 
            this.btnOK.Location = new System.Drawing.Point(13, 0x47); 
            this.btnOK.Name = "btnOK"; 
            this.btnOK.Size = new Size(0x73, 0x15); 
            this.btnOK.TabIndex = 1; 
            this.btnOK.UseVisualStyleBackColor = false; 
            this.btnOK.Click += new EventHandler(this.btnOK_Click); 
            this.btnCancel.BackColor = Color.Transparent; 
            this.btnCancel.DialogResult = DialogResult.No; 
            this.btnCancel.Location = new System.Drawing.Point(0xb9, 0x47); 
            this.btnCancel.Name = "btnCancel"; 
            this.btnCancel.Size = new Size(0x73, 0x15); 
            this.btnCancel.TabIndex = 2; 
            this.btnCancel.UseVisualStyleBackColor = false; 
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click); 
            this.pnlContainer.BackColor = Color.Transparent; 
            this.pnlContainer.Controls.Add(this.lMessage1); 
            this.pnlContainer.Controls.Add(this.btnCancel); 
            this.pnlContainer.Controls.Add(this.btnOK); 
            this.pnlContainer.Controls.Add(this.lMessage); 
            this.pnlContainer.Dock = DockStyle.Fill; 
            this.pnlContainer.Location = new System.Drawing.Point(0, 0); 
            this.pnlContainer.Name = "pnlContainer"; 
            this.pnlContainer.Size = new Size(0x138, 100); 
            this.pnlContainer.TabIndex = 2; 
            this.lMessage1.AutoSize = true; 
            this.lMessage1.Location = new System.Drawing.Point(12, 0x2c); 
            this.lMessage1.Name = "lMessage1"; 
            this.lMessage1.Size = new Size(0x59, 12); 
            this.lMessage1.TabIndex = 3; 
            this.lMessage1.Text = "是否继续更新?"; 
            base.AcceptButton = this.btnOK; 
            base.AutoScaleDimensions = new SizeF(6f, 12f); 
            base.AutoScaleMode = AutoScaleMode.Font; 
            base.CancelButton = this.btnCancel; 
            base.ClientSize = new Size(0x138, 100); 
            base.Controls.Add(this.pnlContainer); 
            base.FormBorderStyle = FormBorderStyle.FixedDialog; 
            base.Icon = (Icon) manager.GetObject("$this.Icon"); 
            base.MaximizeBox = false; 
            base.MinimizeBox = false; 
            base.Name = "ContinueUpdate"; 
            base.StartPosition = FormStartPosition.CenterParent; 
            this.Text = "继续更新"; 
            this.pnlContainer.ResumeLayout(false); 
            this.pnlContainer.PerformLayout(); 
            base.ResumeLayout(false); 
        } 
 
        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; 
        } 
    } 
}