private void btnConnect_Click(object sender, EventArgs e) { if (client.Connect()) { me = client.GetWhoami(); comboBoxTab.DataSource = client.ServerConnectionHandlerList(); comboBoxClient.DataSource = client.GetClientList(); client.ClientNotifyRegister(client.CurrentHandlerId, Notifications.notifytextmessage); client.Notifier.OnTextMessage += Notifier_OnTextMessage; btnConnect.Enabled = false; comboBoxTab.Enabled = true; btnCapture.Enabled = true; comboBoxClient.Enabled = true; btnTcpCapture.Enabled = true; btnImageCapture.Enabled = true; } else { MessageBox.Show("Error"); } }
public Main() { InitializeComponent(); if (ts3Client.Connect() && ts3Client.IsConnected(true)) { if (ts3Client.CurrentHandlerId != 1) { ts3Client.Use(1); } pnlPoke.Enabled = comboBoxClients.Enabled = txtBoxMessage.Enabled = txtBoxLog.Enabled = btnSendPoke.Enabled = true; comboBoxClients.DataSource = ts3Client.GetClientList(); ts3Client.ClientNotifyRegister(ts3Client.CurrentHandlerId, Notifications.notifyclientpoke); ts3Client.Notifier.OnClientPoke += Notifier_OnClientPoke; Client myClient = ts3Client.GetMyClient(); lblNicknameText.Text = myClient.ClientNickname; lblChannelNameText.Text = myClient.Channel.ChannelName; txtBoxLog.Text = ts3Client.Log; } }