public void EndCaptureSession() { if (_session != null) { _session.Dispose(); _session = null; mutex.ReleaseMutex(); } }
/// <summary> /// This method establishes a biometric session. /// Only one session may be created at once. Call BiometricContext.EndSession in order to end the session. /// </summary> /// <returns>IdentityStream.BioAPI.CaptureSession</returns> /// <exception cref="System.ArgumentException" /> /// <exception cref="IdentityStream.BioAPI.BspLoadException" /> /// <exception cref="IdentityStream.BioAPI.LicenseNotAvailableException" /> /// <exception cref="IdentityStream.BioAPI.LicensingException" /> /// <exception cref="IdentityStream.BioAPI.SessionInProgressException" /> public CaptureSession CreateCaptureSession() { if (mutex.WaitOne(TimeSpan.FromSeconds(1), false)) { _session = CreateCaptureSession(CaptureBSPs); return _session; } throw new SessionInProgressException("Unable to create a new session. A session is still in progress."); }