private void LaunchCallback(byte[] data) { byte[] temp = new byte[data.Length - data[1] - 2]; Array.Copy(data, 2 + data[1], temp, 0, temp.Length); NdefParser parser = new NdefParser(temp); RecordData[] payload = parser.GetPayLoad().ToArray(); if (payload.Length > 0) { if (payload[0].NdefType.Equals("U")) { Uri uri = new Uri(payload[0].Content); if (uri.Scheme == 0) { return; } Process.Start(payload[0].Content); } } Task.Run(() => { Thread.Sleep(500); DetectandLaunch(); }); }
private void AddNdefContent(byte[] data) { byte[] temp = new byte[data.Length - data[1] - 2]; Array.Copy(data, 2 + data[1], temp, 0, temp.Length); NdefParser parser = new NdefParser(temp); Action update = () => { foreach (RecordData payload in parser.GetPayLoad()) { ndefData.Text += payload.Content + "\r\n"; } }; Dispatcher.BeginInvoke(update); ShowSuccessStatus(); }