private void reciveAudio(EventAudio eAudio) { try { switch (eAudio.Action) { case ActionTicket.INITIAL: DrawUiLeft(); drawLeft(sortCounter(eAudio.DicCounter)); Thread.Sleep(1000); updateTicketLable(eAudio.DicServing); break; case ActionTicket.ACTION_CALL: string counterID = eAudio.Audio.CounterID; UpdateCounterLeft(eAudio.Action, eAudio.Audio.Cnum, eAudio.Audio.CounterNum, counterID); Thread.Sleep(500); break; case ActionTicket.ACTION_CALL_AUDIO: string couID = eAudio.Audio.CounterID; UpdateUI(eAudio.Action, eAudio.Audio.Cnum, eAudio.Audio.CounterNum, couID); Thread.Sleep(500); break; case ActionTicket.ACTION_FINISH: loadLableTiket("", eAudio.Audio.CounterID); break; case ActionTicket.ACTION_CANCEL: loadLableTiket("", eAudio.Audio.CounterID); break; case ActionTicket.ACTION_MOVE: loadLableTiket("", eAudio.Audio.CounterID); break; //case ActionTicket.ACTION_UPDATE_LABLE: // hideFooter(false); // loadLableTiket("", eAudio.Audio.CounterID); case ActionTicket.RELOAD: EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); break; default: break; } } catch { } }
private void restartAPP() { timeRestart += configMrw.time_next; if (timeRestart > 3600) { if (DateTime.Now.Hour == 23) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } timeRestart = 0; } }
private void SetFORM(bool isReload) { try { Screen[] screens = Screen.AllScreens; if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate() { if (this.Visible && screens.Length == 1 && configMrw.screen_display == 2) { this.Hide(); } }); } else { if (this.Visible && screens.Length == 1 && configMrw.screen_display == 2) { this.Hide(); } } if (screens.Length > 1) { Screen sc = screens.FirstOrDefault(m => m.Primary == false); if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate() { try { if (!this.Visible) { if (isReload) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } else { play2Screen(sc); if (this.Width != sc.WorkingArea.Width || this.Height != sc.WorkingArea.Height) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } } } else if (this.Location != sc.WorkingArea.Location) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } } catch { } }); } else { try { if (!this.Visible) { if (isReload) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } else { play2Screen(sc); if (this.Width != sc.WorkingArea.Width) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } } } else if (this.Location != sc.WorkingArea.Location) { EventScreen eventScreen = new EventScreen(true); DataReceived(eventScreen); } } catch { } } } else if (screens.Length == 1) { if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate() { play1Screen(); }); } else { play1Screen(); } } } catch (Exception e) { MessageBox.Show(e.Message); } }
static void ReloadApp(EventScreen eventScreen) { SetThreadExecutionState(ES_CONTINUOUS); Thread.Sleep(100); Application.Restart(); }