private void RefreshOptional() { string text = rtbComponents.Text; try { rtbComponents.SelectionColor = Color.Black; rtbComponents.AppendText(", "); string[] comps = OptionalComponents.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < comps.Length; i++) { string item = comps[i]; rtbComponents.SelectionStart = rtbComponents.TextLength; rtbComponents.SelectionColor = NLicense.IsComponentActivated(item) ? Color.Green : Color.Red; rtbComponents.AppendText(string.Format("{0} (optional)", item)); if (i != comps.Length - 1) { rtbComponents.SelectionColor = Color.Black; rtbComponents.AppendText(", "); } } } catch { rtbComponents.SelectionColor = Color.Black; rtbComponents.Text = text; throw; } }
private void SetBiometricClientParams() { _biometricClient.FacesMaximalRoll = float.Parse(cbRollAngle.SelectedItem.Value); _biometricClient.FacesMaximalYaw = float.Parse(cbYawAngle.SelectedItem.Value); if (!_isSegmentationActivated.HasValue) { _isSegmentationActivated = NLicense.IsComponentActivated("Biometrics.FaceSegmentsDetection"); } _biometricClient.FacesDetectAllFeaturePoints = _isSegmentationActivated.Value; _biometricClient.FacesDetectBaseFeaturePoints = _isSegmentationActivated.Value; }
private void RefreshRequired() { string text = rtbComponents.Text; try { rtbComponents.Text = string.Empty; int obtainedCount = 0; string[] requiredComponents = RequiredComponents.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < requiredComponents.Length; i++) { string item = requiredComponents[i]; rtbComponents.SelectionStart = rtbComponents.TextLength; if (NLicense.IsComponentActivated(item)) { rtbComponents.SelectionColor = Color.Green; rtbComponents.AppendText(item); obtainedCount++; } else { rtbComponents.SelectionColor = Color.Red; rtbComponents.AppendText(item); } if (i != requiredComponents.Length - 1) { rtbComponents.SelectionColor = Color.Black; rtbComponents.AppendText(", "); } } if (obtainedCount == requiredComponents.Length) { lblStatus.Text = Resources.Licenses_obtained; lblStatus.ForeColor = Color.Green; } else { lblStatus.Text = Resources.Not_all_required_licenses_obtained; lblStatus.ForeColor = Color.Red; } } catch { rtbComponents.SelectionColor = Color.Black; rtbComponents.Text = text; throw; } }
private void CheckLicense() { const string Components = "Biometrics.FaceExtraction," + "Biometrics.FaceDetection," + "Biometrics.FaceMatching," + "Devices.Cameras"; foreach (var component in Components.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) { if (!NLicense.IsComponentActivated(component)) { Logger.Error("License not acquired"); } } licensePanel1.RefreshComponentsStatus(); }
private void ClientInit() { _biometricClient = new NBiometricClient { BiometricTypes = NBiometricType.Face, UseDeviceManager = true }; _biometricClient.Initialize(); _biometricClient.FacesTemplateSize = NTemplateSize.Small; if (!_isSegmentationActivated.HasValue) { _isSegmentationActivated = NLicense.IsComponentActivated("Biometrics.FaceSegmentsDetection"); } _biometricClient.FacesDetectAllFeaturePoints = _isSegmentationActivated.Value; _biometricClient.FacesQualityThreshold = 50; _deviceManager = _biometricClient.DeviceManager; }