Beispiel #1
        ///Connect to Designated IRC Server
        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;
            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);
Beispiel #2
        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);