static void Main(string[] args) { SampleListener listener = new SampleListener(); Controller controller = new Controller(); controller.AddListener(listener); // Keep this process running until Enter is pressed Console.WriteLine("Press Enter to quit..."); Console.ReadLine(); controller.RemoveListener(listener); controller.Dispose(); }
static void Main(string[] args) { Controller controller = new Controller(); SampleListener listener = new SampleListener(); controller.Connect += listener.OnServiceConnect; controller.Device += listener.OnConnect; controller.FrameReady += listener.OnFrame; Console.WriteLine("Press Enter to quit..."); Console.ReadLine(); controller.Dispose(); listener.Dispose(); }