Пример #1
0
 void Disconnect()
 {
     if (Conn == null)
     {
         return;
     }
     Conn.UnregisterListener();
     Conn = null;
 }
Пример #2
0
        void Connect(string hostname, int port, string password)
        {
            if (Conn != null)
            {
                Disconnect();
            }

            Conn = new SamRevAPI(hostname, port, password);
            Conn.OnDataReceive += new SamRevAPI.OnDataReceiveDelegate(Conn_OnDataReceive);
            Conn.RegisterListener();

            labelStatus.Text = "Connected";
            connectToolStripMenuItem.Enabled    = false;
            disconnectToolStripMenuItem.Enabled = true;
        }