| | |
| | | //更新状态变化的事件
|
| | | updateLogic.UpdateStatuChangedEvent += (div, msg) =>
|
| | | {
|
| | | if (div == -1)
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //异常
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | this.CloseForm();
|
| | | }
|
| | | else if (div == 0)
|
| | | {
|
| | | //一般信息
|
| | | btnText.Text = msg;
|
| | | }
|
| | | else if (div == 1)
|
| | | {
|
| | | //升级完成
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | //调用回调函数
|
| | | this.FinishUpdateEvent?.Invoke();
|
| | | this.CloseForm();
|
| | | }
|
| | | else if (div == 2)
|
| | | {
|
| | | //主动终止升级
|
| | | this.CloseForm();
|
| | | }
|
| | | if (div == -1)
|
| | | {
|
| | | //异常
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | this.CloseForm();
|
| | | }
|
| | | else if (div == 0)
|
| | | {
|
| | | //一般信息
|
| | | btnText.Text = msg;
|
| | | }
|
| | | else if (div == 1)
|
| | | {
|
| | | //升级完成
|
| | | btnText.Text = msg;
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | //调用回调函数
|
| | | this.FinishUpdateEvent?.Invoke();
|
| | | this.CloseForm();
|
| | | }
|
| | | });
|
| | | };
|
| | | //进度值改变事件
|
| | | updateLogic.ProgressEvent += (value) =>
|
| | |
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | //进度条
|
| | | decimal result = value / 100;
|
| | | int width = (int)(result * ProRowWidth);
|
| | | int width = (int)(value * ProRowWidth);
|
| | | btnProgressBar.Width = width;
|
| | |
|
| | | //文本显示
|
| | | btnProgressView.Text = value + "%";
|
| | | int persent = (int)(value * 100);
|
| | | btnProgressView.Text = persent + "%";
|
| | | //文本显示的那个图片框移动
|
| | | frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
|
| | | });
|