internal void Close() { // NOTE: Stop gesture recognition, if the host application is not running. if (Settings != null) { Settings.IsToDetectFacesOnDevice.Value = false; // NOTE: If the firmware version is larger than 1.1, stopping hand detection changes the LED color from blue to red. Settings.IsToDetectHandsOnDevice.Value = false; } if (FaceDetectionOnHost != null) { FaceDetectionOnHost.Dispose(); FaceDetectionOnHost = null; } // static event Microsoft.Win32.SystemEvents.DisplaySettingsChanged -= EgsGestureHidReport.OnDisplaySettingsChanged; if (CameraViewImageSourceBitmapCapture != null) { CameraViewImageSourceBitmapCapture.DisposeWithClearingVideoCaptureDeviceInformationOnDeviceDisconnected(); // TODO: FIX: The next line can cause exception, in the other threads or in getting images with a Timer. CameraViewImageSourceBitmapCapture = null; } if (HidReportsUpdate != null) { HidReportsUpdate.OnDisable(); HidReportsUpdate = null; } }
internal void InitializeOnceAtStartup() { if (HidReportsUpdate != null) { HidReportsUpdate.InitializeOnceAtStartup(this); } TouchScreenHidReport.InitializeOnceAtStartup(this); EgsGestureHidReport.InitializeOnceAtStartup(this); AddPropertiesToHidAccessPropertyList(); InitializePropertiesByDefaultValue(); TemperatureInCelsius.ValueUpdated += delegate { OnPropertyChanged(nameof(TemperatureInCelsiusString)); }; TemperatureInFahrenheit.ValueUpdated += delegate { OnPropertyChanged(nameof(TemperatureInFahrenheitString)); }; CameraViewImageSourceBitmapCapture.InitializeOnceAtStartup(this); FaceDetectionOnHost.InitializeOnceAtStartup(this); // static event Microsoft.Win32.SystemEvents.DisplaySettingsChanged += EgsGestureHidReport.OnDisplaySettingsChanged; }
public void ResetSettings() { Settings.Reset(); FaceDetectionOnHost.Reset(); ResetHidReportObjects(); }