Ejemplo n.º 1
0
        void ResetSessions(object sender, string trigger)
        {
            switch (approle)
            {
            case "patient":
            case "enrollment-pc":
            case "enrollment-kiosk":
            case "patient-pc":
            case "patient-kiosk":
                //_patientBridge = new PatientBridge(organizationName, NoIDServiceName);
                _patientBridge.Dispose();
                fingerprintScanAttempts        = 0;
                attemptedScannedFingers        = new List <string>();
                hasLeftFingerprintScan         = true;
                hasRightFingerprintScan        = true;
                currentCaptureInProcess        = false;
                _firstMinutiaCaptureController = null;
                _minutiaCaptureController      = new MinutiaCaptureController(_minimumAcceptedMatchScore);
                //browser.RegisterJsObject("NoIDBridge", _patientBridge);
                break;

            case "provider":
            case "provider-pc":
            case "provider-kiosk":
                _providerBridge = new ProviderBridge(organizationName, NoIDServiceName);
                //browser.RegisterJsObject("NoIDBridge", _providerBridge);
                break;
            }
        }
Ejemplo n.º 2
0
        public BrowserForm()
        {
            InitializeComponent();
            this.MinimizeBox = false;
            this.MaximizeBox = false;

            healthcareNodeWebAddress         = StringUtilities.RemoveTrailingBackSlash(ConfigurationManager.AppSettings["HealthcareNodeWeb"].ToString());
            healthcareNodeChainVerifyAddress = StringUtilities.RemoveTrailingBackSlash(ConfigurationManager.AppSettings["HealthcareNodeChainVerifyAddress"].ToString());

            Text        = "NoID Browser";
            WindowState = FormWindowState.Maximized;

            string endPath = "";


            switch (approle)
            {
            case "patient":
            case "enrollment-pc":
            case "enrollment-kiosk":
            case "patient-pc":
            case "patient-kiosk":
                if (uint.TryParse(MinimumAcceptedMatchScore, out _minimumAcceptedMatchScore) == false)
                {
                    _minimumAcceptedMatchScore = 75;
                }
                Afis.Threshold            = _minimumAcceptedMatchScore;
                _minutiaCaptureController = new MinutiaCaptureController(_minimumAcceptedMatchScore);
                endPath = endPath = healthcareNodeWebAddress + "/enrollment.html";     //TODO: rename to patient.html
                browser = new ChromiumWebBrowser(endPath)
                {
                    Dock = DockStyle.Fill
                };
                _patientBridge = new PatientBridge(organizationName, NoIDServiceName);
                browser.RegisterJsObject("NoIDBridge", _patientBridge);
                _patientBridge.ResetSession    += ResetSessions;
                _patientBridge.JavaScriptAsync += ExecuteJavaScriptAsync;
                break;

            case "provider":
            case "provider-pc":
            case "provider-kiosk":
                endPath = healthcareNodeWebAddress + "/provider.html";
                browser = new ChromiumWebBrowser(endPath)
                {
                    Dock = DockStyle.Fill
                };
                _providerBridge = new ProviderBridge(organizationName, NoIDServiceName);
                browser.RegisterJsObject("NoIDBridge", _providerBridge);
                _providerBridge.JavaScriptAsync += ExecuteJavaScriptAsync;
                break;

            case "healthcare-node-admin-kiosk":
            case "healthcare-node-admin-pc":
                endPath = healthcareNodeWebAddress + "/healthcare.admin.html";
                browser = new ChromiumWebBrowser(endPath)
                {
                    Dock = DockStyle.Fill
                };
                break;

            case "match-hub-admin-kiosk":
            case "match-hub-admin-pc":
                endPath = healthcareNodeWebAddress + "/hub.admin.html";
                browser = new ChromiumWebBrowser(endPath)
                {
                    Dock = DockStyle.Fill
                };
                break;

            default:
                endPath = healthcareNodeWebAddress + "/error.html";     //TODO: We need an HTML error page.
                browser = new ChromiumWebBrowser(endPath)
                {
                    Dock = DockStyle.Fill
                };
                break;
            }

            biometricDevice = new DigitalPersona();
            if (!biometricDevice.StartCaptureAsync(this.OnCaptured))
            {
                this.Close();
            }
#if NAVIGATE
            toolStripContainer.ContentPanel.Controls.Add(browser);
#else
            this.Controls.Add(browser);
#endif
#if NAVIGATE
            browser.StatusMessage += OnBrowserStatusMessage;
            browser.TitleChanged  += OnBrowserTitleChanged;

            browser.ConsoleMessage      += OnBrowserConsoleMessage;
            browser.LoadingStateChanged += OnLoadingStateChanged;
            browser.AddressChanged      += OnBrowserAddressChanged;

            var bitness = Environment.Is64BitProcess ? "x64" : "x86";
            //var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness);
            string initialDisplayText = String.Format(approle.ToString());
            DisplayOutput(initialDisplayText);
#endif
        }