123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
-
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using Tofly.AutoUpdateSystemLibrary;
- namespace Tofly.AutoUpdateSystem.Win
- {
-
-
-
- public partial class FormProgress : Form, Tofly.AutoUpdateSystemLibrary.IFormProgress
- {
-
-
-
- private bool _bShowDynamicInfo = false, _bAutoProgress = true;
- #region IFormProgress 接口实现
-
-
-
- public bool HasCanceled { get; private set; }
-
-
-
- public bool HasCancelButton
- {
- set
- {
- this.btnCancel.Visible = value;
- }
- }
-
-
-
- public event CompleteProcessEventHandler DoCancelOperation;
-
-
-
- public void UpdateTitle(string content)
- {
- try
- {
- if (this._bShowDynamicInfo)
- {
- this.Text = content;
- }
- }
- catch { }
- }
- #endregion
- private FormProgress()
- {
- InitializeComponent();
- }
-
-
-
-
-
-
- public FormProgress(bool showDynamicInfo = false, bool autoProgress = true)
- : this()
- {
- this.Text = "";
- this.lblError.Text = "";
- this.lblProgressInfo.Text = "正在进行处理,请稍候...";
- this._bShowDynamicInfo = showDynamicInfo;
- this._bAutoProgress = autoProgress;
- }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.HasCanceled = true;
- if (this.DoCancelOperation != null)
- {
- this.DoCancelOperation();
- }
- }
- }
- }
|