private void checkAnimation() { while (Visibility == Visibility.Visible && stop == false) { for (int i = 0; i < 6 && Visibility == Visibility.Visible && stop == false; i++) { Thread.Sleep(500); antip.Append(". "); TH.addOnceUI(new Action(() => { tip.Text = antip.ToString(); })); } } if (stop) { TH.addOnceUI(new Action(() => { tip.Text = tipTxt; foreach (Label l in p) { l.Content = ""; } ps.Clear(); index = 0; })); } antip.Clear(); canBeChange = true; }
private void checkHasCarIn() { if (Visibility != Visibility.Visible) { checkTP.stop(); return; } bool hasCarIn = MS2.IfHasCarIn(); if (Visibility != Visibility.Visible) { checkTP.stop(); return; } if (hasCarIn == false) { if (nextStep == null) { TH.addOnceUI(BackExit.Exit); } else { TH.addOnceUI(nextStep); } checkTP.stop(); } }
//private void Border_PreviewMouseDown(object sender, MouseButtonEventArgs e) //{ // if (nextStep != null) // nextStep(); // Hide(); //} public static void show(bool isSuccess, Action nextStep_, string txt) { nextStep = nextStep_; TH.addOnceUI(new Action(() => { if (success == null) { success = new BitmapImage(new Uri(@"../Soruce/Inages_ZQ/成功.png", UriKind.Relative)); failed = new BitmapImage(new Uri(@"../Soruce/Images/失败.png", UriKind.Relative)); } if (st == null) { st = new ShowTip(); } if (isSuccess) { st.ico.Source = success; } else { st.ico.Source = failed; } st.tip.Text = txt; st.Show(); })); }
private void checkPsw() { stop = false; TH.addOnceData(checkAnimation); Thread.Sleep(2000); StringBuilder psw = new StringBuilder(); foreach (string s in ps) { psw.Append(s); } if (psw.ToString() == testPassword) { TH.addOnceUI(new Action(() => { Visibility = Visibility.Hidden; if (nextStep != null) { nextStep(); } tip.Text = ""; foreach (Label l in p) { l.Content = ""; } ps.Clear(); index = 0; })); } else { stop = true; } }
public static void Show(Business2 parent, TIPSTYLE tIPSTYLE, string txt) { TH.addOnceUI(new Action(() => { if (sst == null) { sst = new ShowSubTip(); } if (tIPSTYLE == TIPSTYLE.MachineError) { sst.tipStyle.Source = MachineError; } else if (tIPSTYLE == TIPSTYLE.NoCar) { sst.tipStyle.Source = NoCar; } else { sst.tipStyle.Source = PutCarOutFailed; } sst.error.Text = txt; if (tIPSTYLE != TIPSTYLE.MachineError) { parent.showBackExit(); CD.countDownTime.stop(); } parent.setBusinessValue(sst); })); }
///////////////////功能方法/////////////////////// public void returnToMain() { try { clearTopUI(); mainArea.Child = mainGrid; BackExit.setBack(returnToMain); } catch { TH.addOnceUI(returnToMain); } }
public static void ShowMachineError2() { TH.addOnceUI(new Action(() => { if (CD.business2 == null) { CD.business2 = new Business2(); } CD.countDownTime.stop(); CD.setMainUI(CD.business2); CD.business2.setTitle("异常"); CD.business2.hidenBackExit(); Show(CD.business2, TIPSTYLE.MachineError, "设备故障,请联系管理员处理"); })); }
public static void ShowMachineError1() { TH.addOnceUI(new Action(() => { if (CD.business1 == null) { return; } CD.setMainUI(CD.business1); CD.countDownTime.stop(); CD.business1.setTitle("异常"); CD.business1.hidenBackAndExitBtn(); Show(CD.business1, TIPSTYLE.MachineError, "设备故障,请联系管理员处理"); })); }
public static void show(Action nextStep, string tip, bool isEnd) { TH.addOnceUI(new Action(() => { if (nsui == null) { nsui = new NetStepUI(); } nsui.t.Text = tip; nsui.nextStep = nextStep; if (isEnd) { nsui.ok.Content = "返回首页"; } else { nsui.ok.Content = "领取下一张"; } CD.business1.setBusinessValue(nsui); })); }
private void handle() { string timeTag2 = timeTag; while (isStop == false && nowTime >= 0 && timeTag == timeTag2) { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(updateUI)); nowTime--; Thread.Sleep(1000); } if (isStop == false && nowTime < 0 && timeTag == timeTag2) { if (whenExit != null) { TH.addOnceUI(whenExit); } TH.addOnceUI(BackExit.Exit); } }