Esempio n. 1
0
        ///<Summary>
        ///Connect to Designated IRC Server
        ///</Summary>
        public Conn(Server gui)
        {
            //OnRegister tells us that we have successfully established a connection with
            //the server. Once this is established we can join channels, check for people
            //online, or whatever.
            this.guiForm = gui;
            CreateConnection();
            connection.Listener.OnRegistered += new RegisteredEventHandler(OnRegistered);

            //Listen for any messages sent to the channel
            connection.Listener.OnPublic += new PublicMessageEventHandler(OnPublic);

            //Listen for bot commands sent as private messages
            connection.Listener.OnPrivate += new PrivateMessageEventHandler(OnPrivate);

            //Listen for notification that an error has ocurred
            connection.Listener.OnError += new ErrorMessageEventHandler(OnError);

            //Listen for notification that we are no longer connected.
            connection.Listener.OnDisconnected += new DisconnectedEventHandler(OnDisconnected);
        }
Esempio n. 2
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            SelectServer frmOptions = (SelectServer)((Control)sender).Parent;

                String address = frmOptions.getSelectedServer();
                int port = frmOptions.getSelectedPort();

                Server srv = new Server(address, port);
                srv.Show();
                ((Form)frmOptions).Close();
        }