BlinkIDDemo.MainPage.mRecognizer_OnScanningDone C# (CSharp) Method

mRecognizer_OnScanningDone() public method

Handles completed scanning events. Navigates to results page if scanning was successful.
public mRecognizer_OnScanningDone ( IList resultList, RecognitionType recognitionType ) : void
resultList IList list of recognition results
recognitionType RecognitionType type of recognition
return void
        void mRecognizer_OnScanningDone(IList<Microblink.IRecognitionResult> resultList, RecognitionType recognitionType)
        {
            // navigate to results page if type of recognition is SUCCESSFUL
            if (recognitionType == RecognitionType.SUCCESSFUL) {
                // Find MRTD result in list of results. Should be the only result in the list.
                bool resultFound = false;
                foreach (var result in resultList) {
                    if (result.Valid && !result.Empty) {
                        // check if result is a MRTD result
                        if (result is Microblink.MRTDRecognitionResult) {
                            // obtain the MRTD result
                            Microblink.MRTDRecognitionResult mrtdResult = (Microblink.MRTDRecognitionResult)result;
                            // set it as input for results page
                            ResultsPage.results = mrtdResult.Elements;
                            ResultsPage.resultsType = "MRTD";
                            // mark as found
                            resultFound = true;
                            break;
                        }
                            // check if result is a MyKad result
                        else if (result is Microblink.MyKadRecognitionResult) {
                            // obtain the MyKad result
                            Microblink.MyKadRecognitionResult mykadResult = (Microblink.MyKadRecognitionResult)result;
                            // set it as input for results page
                            ResultsPage.results = mykadResult.Elements;
                            ResultsPage.resultsType = "MyKad";
                            // mark as found
                            resultFound = true;
                            break;
                        }
                            // check if result is a EUDL result
                        else if (result is Microblink.EUDLRecognitionResult) {
                            // obtain the EUDL result
                            Microblink.EUDLRecognitionResult eudlResult = (Microblink.EUDLRecognitionResult)result;
                            // set it as input for results page
                            ResultsPage.results = eudlResult.Elements;
                            ResultsPage.resultsType = "EUDL";
                            // mark as found
                            resultFound = true;
                            break;
                        }
                    }
                }
                // navigate to results page if MRTD result was found
                if (resultFound) {
                    NavigationService.Navigate(new Uri("/ResultsPage.xaml", UriKind.Relative));
                }
            }
        }