/* IScanditSDKListener methods */ public void DidScanBarcode(string barcode, string symbology) { barcodePicker.StopScanning(); /* Do something once a barcode has been scanned */ Console.WriteLine("barcode scanned: {0}, '{1}'", symbology, barcode); var contactInfo = barcode.Split(','); // user id, first, last // TODO: temp code - move to view model var service = TinyIoC.TinyIoCContainer.Current.Resolve <CouchbaseConnect2014.Services.ICouchbaseService> (); var contactId = service.GetUserId(); var contactExchange = new CouchbaseConnect2014.Models.ContactExchange() { LocalUserId = contactId, UserId = contactInfo[0], First = contactInfo[1], Last = contactInfo[2] }; var repo = TinyIoC.TinyIoCContainer.Current.Resolve <CouchbaseConnect2014.Services.IRepository> (); repo.SaveContactExchange(contactExchange); // end of temp code var message = string.Format("You have swapped contact info with {0} {1}.", contactInfo[1], contactInfo[2]); Toast.MakeText(this.Context, message, ToastLength.Short).Show(); barcodePicker.StartScanning(); }
protected override void OnPause() { picker.StopScanning(); base.OnPause(); }