public BBotLeapMotionWrapper() { // Create a sample listener and controller listener = new SampleListener(); controller = new Controller(); StopRead = false; ThreadStart starter = () => Read(ref listener, ref controller); leapReadThread = new Thread(starter); leapReadThread.Name = "BBotLeapMotionWrapper:ReadThread"; leapReadThread.Start(); }
void Read(ref SampleListener Listener, ref Controller Controller) { // Have the sample listener receive events from the controller Controller.AddListener(Listener); while (!StopRead) { //Do thing here //The listener class is gathering our data } // Remove the sample listener when done Controller.RemoveListener(Listener); Controller.Dispose(); Listener.Dispose(); }
void Read( ref SampleListener Listener, ref Controller Controller) { // Have the sample listener receive events from the controller Controller.AddListener(Listener); while (!StopRead) { //Do thing here //The listener class is gathering our data } // Remove the sample listener when done Controller.RemoveListener(Listener); Controller.Dispose(); Listener.Dispose(); }