using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; namespace Mesnac.Action.ChemicalWeighing.Sys { public partial class FrmNotify : Form { private string _notifyText; private int _value; private FrmNotify() { InitializeComponent(); this._value = 0; } /// /// 提示文本 /// public string NotifyText { get { return this._notifyText; } set { this._notifyText = value; } } /// /// 进度值,最大值为100 /// public int Value { get { return this._value; } set { if (value > 100) { value = 100; } this._value = value; this.SetProgreccBar(this._value, this._notifyText); //向网络发送进度 //string netMsg = "{0}:{1}/"; //netMsg = String.Format(netMsg, Global.ProtocalHeader.ReceiveRecipeDownLoadStatu, value.ToString()); //Mesnac.Communication.TcpService.Instance.NetSendMsg(netMsg); } } /// /// 显示进度条的信息 /// /// 进度条的当前值 /// 当前提示信息 public void SetProgreccBar(int value, string strInfor) { this.labInfor.Text = strInfor; this.pbInfor.Value = value; this.labInfor.Refresh(); } #region 单例实现 private static FrmNotify _instance = null; public static FrmNotify Instance { get { if (_instance == null || _instance.IsDisposed) { _instance = new FrmNotify(); _instance.Show(); } return _instance; } } public void Destory() { if (_instance != null && !_instance.IsDisposed) { _instance.Close(); _instance = null; } } #endregion } }