Esempio n. 1
0
        public void connect()
        {
            if (connected)
            {
                // Remove the listener
                controller.RemoveListener(listener);
                controller.Dispose();
                connected          = false;
                connectbutton.Text = "Connect";
                fps_label.Text     = "disconnected";
            }
            else
            {
                // Create listener and controller
                listener      = new SampleListener();
                listener.form = this;
                controller    = new Controller();

                if (controller.IsConnected)
                {
                    controller.AddListener(listener);
                    connectbutton.Text = "Disconnect";
                    connected          = true;
                }
            }
        }
Esempio n. 2
0
        public void connect()
        {
            if (connected)
            {
                // Remove the listener
                controller.RemoveListener(listener);
                controller.Dispose();
                connected = false;
                connectbutton.Text = "Connect";
                fps_label.Text = "disconnected";
            }
            else
            {
                // Create listener and controller
                listener = new SampleListener();
                listener.form = this;
                controller = new Controller();

                if (controller.IsConnected)
                {
                    controller.AddListener(listener);
                    connectbutton.Text = "Disconnect";
                    connected = true;
                }
            }
        }