Пример #1
0
 /// <summary>
 /// Обработчик изменения коллекции
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void EventHandlerDevicesCollectionWasChanged(
     object sender, KeyedCollectionWasChangedEventArgs<DeviceBase> e)
 {
     // В случае изменения коллекции переопределяем контекст
     lock (_SyncRoot)
     {
         _Context = new Context(_NetworkController.Devices.ToArray());
     }
 }
Пример #2
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="controller">Контроллер сети</param>
 public ServiceNmt(INetworkController controller)
     : base(controller)
 {
     //Инициализируем контексты устройств
     _Context = new Context(_NetworkController.Devices.ToArray());
     _NetworkController.Devices.CollectionWasChanged += 
         new EventHandler<KeyedCollectionWasChangedEventArgs<DeviceBase>>(
         EventHandlerDevicesCollectionWasChanged);
 }
Пример #3
0
        /// <summary>
        /// 
        /// </summary>
        public override void Start()
        {
            _Context = new Context(_NetworkController.Devices.ToArray());

            base.Start();
        }
Пример #4
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="controller">Контроллер сети</param>
 public ServiceNodeGuard(INetworkController controller)
     : base(controller)
 {
     _Context = new Context(_NetworkController.Devices.ToArray());
     
     _NetworkController.Devices.CollectionWasChanged += 
         new EventHandler<KeyedCollectionWasChangedEventArgs<DeviceBase>>(
         EventHandlerDevicesCollectionWasChanged);
 }