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.Feeding.Qingquan.Sys { public partial class FrmNotify : Form { private string _notifys; private int _value; private FrmNotify() { InitializeComponent(); this._value = 0; } public string Notifys { get { return this._notifys; } set { this._notifys = value; } } public int Value { get { return this._value; } set { if (value > 100) { value = 100; } this._value = value; this.SetProgreccBar(this._value, this._notifys); //向网络发送进度 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 } }