示例#1
0
        private void DeviceDepartedHandler(INfcAdapter sender, NfcDeviceEventArgs args)
        {
            var device   = args.Device;
            var deviceId = device.Id;

            lock (lockObject)
            {
                Devices.Remove(deviceId);
            }
        }
示例#2
0
        private void DeviceArrivedHandler(INfcAdapter sender, NfcDeviceEventArgs args)
        {
            var device   = args.Device;
            var deviceId = device.Id;

            lock (lockObject)
            {
                if (!Devices.ContainsKey(deviceId))
                {
                    Devices[deviceId] = new ProxiedNfcDevice(sender, device);
                }
            }
        }