Exemplo n.º 1
0
        private void Clean()
        {
            swipeGestureRecognizer.OnGestureDetected -= OnGestureDetected;

            CloseGestureDetector();

            ClosePostureDetector();

            if (voiceCommander != null)
            {
                voiceCommander.OrderDetected -= voiceCommander_OrderDetected;
                voiceCommander.Dispose();
                voiceCommander = null;
            }

            if (recorder != null)
            {
                recorder.Stop();
                recorder = null;
            }

            if (kinectRuntime != null)
            {
                kinectRuntime.SkeletonFrameReady -= kinectRuntime_SkeletonFrameReady;
                kinectRuntime.VideoFrameReady    -= kinectRuntime_VideoFrameReady;
                kinectRuntime.Uninitialize();
                kinectRuntime = null;
            }
        }
Exemplo n.º 2
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            CloseGestureDetector();

            ClosePostureDetector();

            voiceCommander.Stop();

            if (recorder != null)
            {
                recorder.Stop();
            }
        }
Exemplo n.º 3
0
        public override void Destroy()
        {
            if (this.runtime != null)
            {
                this.runtime.SkeletonFrameReady -= SkeletonFrameReady;
                this.runtime.Uninitialize();
            }

            if (isRecorder)
            {
                recorder.Stop();
                if (this.fileStream != null)
                {
                    this.fileStream.Close();
                }
            }
        }