private static bool IsTagValid(NFCSharp.NFCTag tag)
        {
            if (tag == null)
            {
                return(false);
            }
            try
            {
                var ndef = tag.NDEFRead();
                if (ndef.Count != 5)
                {
                    return(false);
                }

                for (int i = 0; i < 5; i++)
                {
                    if (ndef[i].Payload == null || (_encryptData && EncDec.Unprotect(ndef[i].Payload) == null))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Log(" IsTagValid: NDEFRead failed:" + ex.HResult + " - " + ex.ToString());
                // -2146233088 is a parse error which usually means the tag isn't formatted
                if (ex.HResult != -2146233088)
                {
                    System.Diagnostics.Debug.WriteLine("NDEFRead failed:" + ex.ToString());
                    return(false);
                }
            }
            return(false);
        }
 public NFCHoloDevice(NFCSharp.NFCTag tag)
 {
     _tag = tag;
     if (Load())
     {
         Initialize(false);
     }
 }