public NfcForms() { nfcTag = new NfcFormsTag(); if (ProximityDevice.GetDefault() != null) { nfcDevice = ProximityDevice.GetDefault(); nfcDevice.SubscribeForMessage("NDEF", MessageReceivedHandler); nfcTag.IsWriteable = false; nfcTag.MaxSize = 0; nfcDevice.DeviceArrived += nfcDevice_DeviceArrived; nfcDevice.DeviceDeparted += nfcDevice_DeviceDeparted; } }
private void RaiseTagDisconnected(NfcFormsTag tag) { nfcTag.IsConnected = false; if (TagDisconnected != null) { TagDisconnected(this, tag); } }
private void RaiseNewTag(NfcFormsTag tag) { if (NewTag != null) { NewTag(this, tag); } }
public NfcForms () { NfcManager NfcManager = (NfcManager)Android.App.Application.Context.GetSystemService(Context.NfcService); nfcDevice = NfcManager.DefaultAdapter; nfcTag = new NfcFormsTag (); }
public void RaiseTagConnected(NfcFormsTag tag) { nfcTag.IsConnected = true; if (TagConnected != null) { TagConnected(this, tag); } }
void device_TagDisconnected(object sender, NfcFormsTag e) { #if SILVERLIGHT System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { IsConnected.IsToggled = false; }); #else IsConnected.IsToggled = false; #endif }
void HandleNewTag(object sender, NfcFormsTag e) { #if SILVERLIGHT System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { welcomePanel.IsVisible = false; IsWriteable.IsToggled = e.IsWriteable; IsNDEFSupported.IsToggled = e.IsNdefSupported; if (TechList != null) TechList.ItemsSource = e.TechList; if (e.IsNdefSupported) NDEFMessage.ItemsSource = readNDEFMEssage(e.NdefMessage); }); #else welcomePanel.IsVisible = false; IsWriteable.IsToggled = e.IsWriteable; IsNDEFSupported.IsToggled = e.IsNdefSupported; if(TechList != null) TechList.ItemsSource = e.TechList; if (e.IsNdefSupported) NDEFMessage.ItemsSource = readNDEFMEssage(e.NdefMessage); #endif }