private void _nfcReader_TagFound(NFCTag tag) { // we get called twice for some reason. if (_busy) { return; } if (ShuttingDown) { return; } Log(" _nfcReader_TagFound"); if (_currentTag != null && _currentTag.UID == tag.UID) { return; } _currentTag = tag; CurrentDevice = new NFCHoloDevice(_currentTag); foreach (Delegate d in DeviceArrived.GetInvocationList()) { ISynchronizeInvoke syncer = d.Target as ISynchronizeInvoke; if (syncer != null) { syncer.BeginInvoke(d, new NFCHoloDevice[] { CurrentDevice }); } else { d.DynamicInvoke(CurrentDevice); } } }
private void _nfcReader_TagLost() { Log("_nfcReader_TagLost"); if (DeviceDeparted != null) { foreach (Delegate d in DeviceDeparted.GetInvocationList()) { ISynchronizeInvoke syncer = d.Target as ISynchronizeInvoke; if (syncer != null) { syncer.BeginInvoke(d, new HoloDevice[] { CurrentDevice }); } else { d.DynamicInvoke(CurrentDevice); } } } _busy = false; _currentTag = null; CurrentDevice = null; }
private void _nfcHoloReader_DeviceArrived(NFCHoloDevice device) { SetCurrentDevice(device); }
private void _nfcHoloReader_DeviceDeparted(NFCHoloDevice device) { SetCurrentDevice(null); }