コード例 #1
0
        public void Scan(IOverlaySettings overlaySettings)
        {
            recognizerBundle = null;
            documentCaptureRecognizerTransferable = null;
            documentCaptureRecognizerWrapper      = null;
            fieldByFieldCollection = null;
            fieldByFieldBundle     = null;

            androidHostActivity.ScanningStarted(this);
            var aOverlaySettings = (OverlaySettings)overlaySettings;

            if (aOverlaySettings is DocumentCaptureOverlaySettings)
            {
                documentCaptureRecognizerTransferable = ((DocumentCaptureUISettings)aOverlaySettings.NativeUISettings).DocumentCaptureRecognizerTransferable;
                documentCaptureRecognizerWrapper      = ((DocumentCaptureOverlaySettings)aOverlaySettings).DocumentCaptureRecognizerWrapper;
                ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
                return;
            }
            if (aOverlaySettings is FieldByFieldOverlaySettings)
            {
                var fieldByFieldOverlaySettings = (FieldByFieldOverlaySettings)aOverlaySettings;
                fieldByFieldCollection = fieldByFieldOverlaySettings.FieldByFieldCollection;
                var nativeOverlay = (FieldByFieldUISettings)fieldByFieldOverlaySettings.NativeUISettings;
                fieldByFieldBundle = nativeOverlay.FieldByFieldBundle;

                ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, nativeOverlay);
                return;
            }

            // assume given recognizerCollection was also used for constructing overlaySettings
            recognizerBundle = ((RecognizerCollection)((RecognizerCollectionOverlaySettings)aOverlaySettings).RecognizerCollection).NativeRecognizerBundle;
            ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
        }
コード例 #2
0
        public void Scan(IOverlaySettings overlaySettings)
        {
            androidHostActivity.ScanningStarted(this);
            var aOverlaySettings = (OverlaySettings)overlaySettings;

            // assume given recognizerColelction was also used for constructing overlaySettings
            recognizerBundle = ((RecognizerCollection)aOverlaySettings.RecognizerCollection).NativeRecognizerBundle;
            ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
        }