示例#1
0
        void ScanPage_OnScanResult(ZXing.Result result)
        {
            // Stop scanning
            scanPage.IsScanning = false;
            // Pop the page and show the result
            Device.BeginInvokeOnMainThread(async() =>
            {
                await Navigation.PopAsync();

                if (vm.Hack.UnlockCode == result.Text)
                {
                    await vm.FinishHack();
                    await DisplayAlert("Congratulations", "You successfully finished the Mini-Hack!", "OK");
                }
                else
                {
                    await DisplayAlert("Mini-Hack Issue", $"That doesn't seem to be the right code. Please see a {EventInfo.MiniHackStaffMemberName} to help finish the Mini-Hack.", "OK");
                }
            });
        }
        void ScanPage_OnScanResult(ZXing.Result result)
        {
            // Stop scanning
            scanPage.IsScanning = false;
            // Pop the page and show the result
            Device.BeginInvokeOnMainThread(async() => {
                await Navigation.PopAsync();

                //admin app will append on evolve to the end to it is unique.
                if (vm.Hack.UnlockCode + "evolve" == result.Text)
                {
                    vm.FinishHack();
                    App.Logger.Track("FinishedHack", "Name", vm.Hack.Name);
                    await DisplayAlert("Congratulations", "You successfully finished the Mini-Hack!", "OK");
                }
                else
                {
                    await DisplayAlert("Mini-Hack Issue", "That doesn't seem to be the right code. Please see a Xamarin to help finish the Mini-Hack.", "OK");
                }
            });
        }