コード例 #1
0
 public static void PlcStatusChange(string name, bool status, string statusName)
 {
     for (int i = 0; i < _plcStatusList.Count; i++)
     {
         if (_plcStatusList.ElementAt(i).plcName == name)
         {
             PlcStatus plcStatus = _plcStatusList.ElementAt(i);
             if (plcStatus.statusName != statusName)
             {
                 plcStatus.status     = status;
                 plcStatus.statusName = statusName;
                 System.Windows.Application.Current.Dispatcher.Invoke(
                     DispatcherPriority.Send,
                     (Action) delegate()
                 {
                     _plcStatusList.RemoveAt(i);
                 }
                     );
                 System.Windows.Application.Current.Dispatcher.Invoke(
                     DispatcherPriority.Send,
                     (Action) delegate()
                 {
                     _plcStatusList.Insert(i, plcStatus);
                 }
                     );
                 DoGlobalPropertyChanged("plcStatusList");
             }
         }
     }
 }
コード例 #2
0
 public static void AddPlcStatus(PlcStatus plcStatus)
 {
     System.Windows.Application.Current.Dispatcher.Invoke(
         DispatcherPriority.Normal,
         (Action) delegate()
     {
         _plcStatusList.Add(plcStatus);
     }
         );
     DoGlobalPropertyChanged("plcStatusList");
 }
コード例 #3
0
 public static void AddPlcStatus(PlcStatus plcStatus)
 {
     System.Windows.Application.Current.Dispatcher.Invoke(
             DispatcherPriority.Normal,
             (Action)delegate ()
             {
                 _plcStatusList.Add(plcStatus);
             }
         );
     DoGlobalPropertyChanged("plcStatusList");
 }