Exemple #1
0
 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;
     }
 }
Exemple #2
0
 private void RaiseTagDisconnected(NfcFormsTag tag)
 {
     nfcTag.IsConnected = false;
     if (TagDisconnected != null)
     {
         TagDisconnected(this, tag);
     }
 }
Exemple #3
0
 private void RaiseNewTag(NfcFormsTag tag)
 {
     if (NewTag != null)
     {
         NewTag(this, tag);
     }
 }
Exemple #4
0
		public NfcForms ()
		{
			NfcManager NfcManager =	(NfcManager)Android.App.Application.Context.GetSystemService(Context.NfcService);		
			nfcDevice = NfcManager.DefaultAdapter;
		    nfcTag = new NfcFormsTag ();
		}
Exemple #5
0
        public void RaiseTagConnected(NfcFormsTag tag)
		{
			nfcTag.IsConnected = true;
	
			if (TagConnected != null)
			{
				TagConnected(this, tag);
			}
		}
Exemple #6
0
        void device_TagDisconnected(object sender, NfcFormsTag e)
        {
#if SILVERLIGHT
            System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                IsConnected.IsToggled = false;
            });
#else
            IsConnected.IsToggled = false;
#endif

        }
Exemple #7
0
        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
        }