Пример #1
0
        public PonyboxForm()
        {
            InitializeComponent();
            client = new PonyboxClient();


            LoginForm frm = new LoginForm();


            string res = "";

            do
            {
                frm.ShowDialog();

                res = PonyboxClient.LoadUser(frm.GetUser(), frm.GetPass());
            } while (res == "");
            client.LoadUser(res);

            /*
             * frm.ShowDialog();
             * client.SetUserData(int.Parse(frm.GetUser()), frm.GetPass());
             */

            client.LoadChatbox();
            client.Connect();

            client.BindForm(this);
            client.BindMessageListCallback("UpdateMessages");
            client.BindMessageInsertCallback("InsertMessage");
            client.BindChannelListCallback("UpdateChannels");

            client.RefreshChannelList();
            client.JoinChannel("general");
        }
Пример #2
0
        public void onChannelListRefreshed(object sender, PonyboxClient.ChannelListRefreshedEvent e)
        {
            List <Channel> channels = e.channels;
            var            source   = new AutoCompleteStringCollection();

            string[] names = new string[channels.Count];

            for (int i = 0; i < channels.Count; i++)
            {
                names[i] = channels[i].GetName();

                client.JoinChannel(channels[i].GetName());
            }

            source.AddRange(names);

            textBoxChannel.Invoke((MethodInvoker) delegate
            {
                textBoxChannel.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                textBoxChannel.AutoCompleteCustomSource = source;
            });
        }
Пример #3
0
 private void buttonJoin_Click(object sender, EventArgs e)
 {
     client.JoinChannel(textBoxChannel.Text);
 }
Пример #4
0
 public void JoinChannel(Channel c)
 {
     CreateChannelTab(c);
     client.JoinChannel(c.GetName());
     this.currentChannel = c;
 }