コード例 #1
0
 public ChannelInterfaceWindow(Channel channel)
 {
     InitializeComponent();
     this.Channel = channel;
     Channel.messageSent += new EventHandler(Channel_messageReceived);
     Channel.membersChanged += new EventHandler(updateUsers);
 }
コード例 #2
0
ファイル: IrcNetwork.cs プロジェクト: JLF8086/Visual-C-
        public void ParseChannelMessage(Channel chan, string msg)
        {
            if (msg == String.Empty)
                return;
            if (msg[0] != '/')
            {
                SendMessage("PRIVMSG " + chan.Name + " :" + msg);
                chan.WriteChannelMessage(this.Nick, msg);
                return;
            }
            switch(msg.IndexOf(' ') > 0 ? msg.Substring(0, msg.IndexOf(' ')) : msg)
            {
                case "/part":
                    {
                        SendMessage("PART " + chan.Name);
                    }  break;
                case "/mode":
                    {
                        SendMessage("MODE " + chan.Name + ' ' + msg.Remove(0, "/mode".Length));
                        //System.Windows.MessageBox.Show("MODE " + chan.Name + ' ' + msg.Remove(0, msg.IndexOf('#') + chan.Name.Length + 2));
                    }  break;
                case "/topic":
                    {
                        SendMessage("TOPIC " + chan.Name + " :" + msg.Remove(0, "/topic".Length));
                    }  break;
                case "/kick":
                    {
                        SendMessage("KICK " + chan.Name + ' ' + msg.Remove(0, "/kick".Length));
                    }  break;
                default:
                    {
                        ParseCommand(msg);
                    }  break;

            }
        }
コード例 #3
0
ファイル: IrcNetwork.cs プロジェクト: JLF8086/Visual-C-
 public void JoinChannel(Channel chan)
 {
     this.Channels.Add(chan);
     if (joinedChannel != null)
         joinedChannel(this, new ChannelEventArgs() { Channel = chan });
 }