private void button1_Click(object sender, RoutedEventArgs e) { button1.IsEnabled = false; button.IsEnabled = true; if (biliLive != null) { biliLive.Disconnect(); biliLive = null; } }
static void Main(string[] args) { args = args.Length > 0 ? args : new[] { "34083" }; int roomId; if (args.Length > 0 && int.TryParse(args[0], out roomId)) { DanmakuLoader b = new BiliDMLib.DanmakuLoader(); b.Disconnected += b_Disconnected; b.ReceivedDanmaku += b_ReceivedDanmaku; b.ReceivedRoomCount += b_ReceivedRoomCount; b.ConnectAsync(roomId); Thread.Sleep(233333333); } }
private async void button_Click(object sender, RoutedEventArgs e) { button.IsEnabled = false; button1.IsEnabled = true; string roomId = textBox.GetLineText(0); int nId = int.Parse(roomId); if (biliLive == null) { biliLive = new BiliDMLib.DanmakuLoader(); biliLive.Disconnected += b_Disconnected; biliLive.ReceivedDanmaku += b_ReceivedDanmaku; biliLive.ReceivedRoomCount += b_ReceivedRoomCount; await biliLive.ConnectAsync(nId); } }