예제 #1
0
        public void Dispose()
        {
            _vgbFrameReader.IsPaused = true;
            _vgbFrameReader.Dispose();
            _vgbFrameReader = null;

            _vgbFrameSource.Dispose();
            _vgbFrameSource.Dispose();
        }
예제 #2
0
 public void DestroySource()
 {
     if (_Source != null)
     {
         _Source.Dispose();
         _Source = null;
     }
     if (_Reader != null)
     {
         _Reader.Dispose();
         _Reader = null;
     }
 }
예제 #3
0
        public void Dispose()
        {
            if (_gestureReader != null)
            {
                _gestureReader.Dispose();
            }
            _gestureReader = null;

            if (_gestureSource != null)
            {
                _gestureSource.Dispose();
            }
            _gestureSource = null;
        }
예제 #4
0
        public void Dispose()
        {
            if (!ReferenceEquals(null, VgbFrameReader))
            {
                VgbFrameReader.Dispose();
                VgbFrameReader = null;
            }

            if (!ReferenceEquals(null, _vgbFrameSource))
            {
                _vgbFrameSource.Dispose();
                _vgbFrameSource = null;
            }
        }
        internal override void OnStop()
        {
            if (_frameReader != null)
            {
                _frameReader.FrameArrived -= FrameArrived;
                _frameReader.Dispose();
                _frameReader = null;
            }

            if (_frameSource != null)
            {
                _frameSource.Dispose();
                _frameSource = null;
            }
        }
        /* Disposal of the class object */
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (vgbFrameReader != null)
                {
                    vgbFrameReader.FrameArrived -= Reader_GestureFrameArrived;
                    vgbFrameReader.Dispose();
                    vgbFrameReader = null;
                }

                if (vgbFrameSource != null)
                {
                    vgbFrameSource.Dispose();
                    vgbFrameSource = null;
                }
            }
        }
 void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (multiFrameReader != null)
     {
         multiFrameReader.Dispose();
         multiFrameReader = null;
     }
     if (gestureFrameReader != null)
     {
         gestureFrameReader.Dispose();
         gestureFrameReader = null;
     }
     if (kinect != null)
     {
         kinect.Close();
         kinect = null;
     }
 }
    private void FinishVisualGestures()
    {
        if (vgbFrameReader != null)
        {
            vgbFrameReader.Dispose();
            vgbFrameReader = null;
        }

        if (vgbFrameSource != null)
        {
            vgbFrameSource.Dispose();
            vgbFrameSource = null;
        }

        if (gestureData != null)
        {
            gestureData.Clear();
        }
    }
예제 #9
0
        /// <summary>
        /// Disposes the VisualGestureBuilderFrameSource and VisualGestureBuilderFrameReader objects
        /// </summary>
        /// <param name="disposing">True if Dispose was called directly, false if the GC handles the disposing</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_vgbFrameReader != null)
                {
                    _vgbFrameReader.FrameArrived -= Reader_GestureFrameArrived;
                    _vgbFrameReader.Dispose();
                    _vgbFrameReader = null;
                }

                if (_vgbFrameSource != null)
                {
                    _vgbFrameSource.TrackingIdLost -= Source_TrackingIdLost;
                    _vgbFrameSource.Dispose();
                    _vgbFrameSource = null;
                }
            }
        }
    void CleanUnValidBody(Hashtable _Hashnewids)
    {
        if (_Hashnewids != null)
        {
            ArrayList key = new ArrayList(HashIdtb.Keys);
            foreach (ulong id in key)
            {
                if (!_Hashnewids.ContainsKey(id)) //use the pass IDlist to check if the new IDlist still has that value
                {
                    Dictionary <VisualGestureBuilderFrameSource, VisualGestureBuilderFrameReader> tempgroup = HashIdtb[id] as Dictionary <VisualGestureBuilderFrameSource, VisualGestureBuilderFrameReader>;
                    //this is our bodyid coorespond to the gesture result
                    foreach (VisualGestureBuilderFrameSource single_group in tempgroup.Keys) // we only have 1 group in this dictionary
                    {
                        disposesource = single_group;
                        disposereader = tempgroup[single_group];
                    }
                    tempgroup.Clear();
                    if (disposesource != null)
                    {
                        disposesource.Dispose();
                        disposesource = null;
                    }
                    if (disposereader != null)
                    {
                        disposereader.IsPaused = true;
                        // disposereader.FrameArrived-=GestureFrameArrived;


                        disposereader.Dispose();
                        disposereader = null;
                    }
                    HashIdtb.Remove(id); //Remove the Id from our trackedIDtable(the "HashIdtb")
                    PlayerArgs.Remove(id);
                    Debug.Log("Remove a " + id);
                }
            }
        }
    }