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"); }
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; }); }
private void buttonJoin_Click(object sender, EventArgs e) { client.JoinChannel(textBoxChannel.Text); }
public void JoinChannel(Channel c) { CreateChannelTab(c); client.JoinChannel(c.GetName()); this.currentChannel = c; }