private void Removed(CpDeviceReprogramList aList, CpDeviceReprogrammable aDevice)
        {
            CpDeviceFacDef device = null;

            lock (iLock)
            {
                if (iDisposed)
                {
                    return;
                }

                foreach (CpDeviceFacDef d in iDeviceFacDefList)
                {
                    if (d.MacAddress == aDevice.MacAddress)
                    {
                        UserLog.WriteLine(DateTime.Now + ": CpDeviceUpdateList: DeviceUpdateable-             MacAddress{" + aDevice.MacAddress + "}");

                        device = d;
                        iDeviceFacDefList.Remove(d);
                        break;
                    }
                }
            }

            if (device != null)
            {
                if (iRemoved != null)
                {
                    iRemoved(this, device);
                }

                device.Dispose();
            }
        }
        private void Added(CpDeviceReprogramList aList, CpDeviceReprogrammable aDevice)
        {
            CpDeviceFacDef device = null;

            lock (iLock)
            {
                if (iDisposed)
                {
                    return;
                }

                UserLog.WriteLine(DateTime.Now + ": CpDeviceUpdateList: DeviceUpdateable+             MacAddress{" + aDevice.MacAddress + "}");

                device = new CpDeviceFacDef(aDevice, iAdapterAddress, iUpdateListener);
                iDeviceFacDefList.Add(device);

                aDevice.Changed += HandleChanged;
            }

            if (device != null)
            {
                if (iAdded != null)
                {
                    iAdded(this, device);
                }
            }
        }
Beispiel #3
0
        public CpDeviceReprogramListRepeater()
        {
            iLock     = new object();
            iDisposed = false;

            iDeviceListReprogrammable = new List <CpDeviceReprogrammable>();
            iDeviceListReprogram      = new CpDeviceReprogramList(AddedHandler, RemovedHandler);
        }
Beispiel #4
0
        private void RemovedHandler(CpDeviceReprogramList aList, CpDeviceReprogrammable aDevice)
        {
            lock (iLock)
            {
                if (iDisposed)
                {
                    return;
                }
            }

            if (Removed != null)
            {
                Removed(this, new CpDeviceReprogrammableEventArgs(aDevice));
            }
        }