private void Init() { try { HandleError(OpenNI.Initialize()); NiTE.Initialize(); OpenNI.OnDeviceConnected += OpenNiOnDeviceConnectionStateChanged; OpenNI.OnDeviceDisconnected += OpenNiOnDeviceConnectionStateChanged; OpenNI.OnDeviceStateChanged += OpenNiOnDeviceStateChanged; UpdateDevicesList(); notify.Visible = !Settings.Default.AutoNotification; ReadSettings(); } catch (Exception ex) { MessageBox.Show( string.Format("Fatal Error: {0}", ex.Message), @"Execution Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(1); } }
private void FrmMainFormClosed(object sender, FormClosedEventArgs e) { OpenNI.Shutdown(); NiTE.Shutdown(); }
private void FrmMainFormClosing(object sender, FormClosingEventArgs e) { userTracker?.Dispose(); NiTE.Shutdown(); OpenNI.Shutdown(); }
private void FrmMainFormClosing(object sender, FormClosingEventArgs e) { NiTE.Shutdown(); OpenNI.Shutdown(); }