private void Window_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objVLCDba == null) { objVLCDba = new VLCDba(); } lblMachineName.Content = this.MachineCode; SetTriggerStatus(objGeneralDba.GetMachineTriggerStatus(this.MachineCode)); SetEnableStatus(objVLCDba.GetVLCEnabledStatus(this.MachineCode)); }
void timerToUpdateStatus_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetLockedStatus), objVLCDba.GetVLCBlockedStatus(MachineCode)); triggerStatus.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetTriggerStatus), objGeneralDba.GetMachineTriggerStatus(MachineCode)); disableGrid.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetDisableStatus), !objVLCDba.GetVLCEnabledStatus(MachineCode)); this.QueueId = objVLCDba.GetVLCQueueId(this.MachineCode); cardIdLabel.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegateForString(SetCardId), objGeneralDba.GetCardIdFromQueue(this.QueueId)); }