コード例 #1
0
ファイル: conn.cs プロジェクト: Iciclebar/ThreshIRC
        ///<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);
        }
コード例 #2
0
ファイル: program.cs プロジェクト: Iciclebar/ThreshIRC
        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();
        }