private void Setting_Click(object sender, RoutedEventArgs e) { if (networkThread != null) { networkThread.Abort(); networkSocket.Close(); } if (auditWindow != null) { auditWindow.Close(); auditWindow = null; } Window sw = new Settings(); sw.ShowDialog(); OhMyDanmaku_Init(); }
private void OhMyDanmaku_Init() { setSize(GlobalVariable._RENDER_WIDTH, GlobalVariable._RENDER_HEIGHT); lib = new wpfDanmakulib( danmakuRender, ra, true, InitCompleted, GlobalVariable._user_danmaku_Duration, GlobalVariable._user_danmaku_FontSize, GlobalVariable._user_danmaku_EnableShadow, GlobalVariable._user_danmaku_colorR, GlobalVariable._user_danmaku_colorG, GlobalVariable._user_danmaku_colorB ); if (GlobalVariable._user_audit) { auditWindow = new Audit(this); auditWindow.Show(); } networkThread = new Thread(() => networkListenLoop(GlobalVariable._user_com_port, GlobalVariable._user_audit)); networkThread.IsBackground = true; networkThread.Name = "CommunicationThread"; networkThread.Start(); //Start listener thread }