private void button2_Click(object sender, EventArgs e) { DanmuManager.getInstance().closeSocket(); appendText("[System]Disconnect"); button1.Enabled = true; button2.Enabled = false; }
public static DanmuManager getInstance() { if (instance == null) { instance = new DanmuManager(); } return(instance); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 f = new Form1(); DanmuManager.getInstance().setWindow(f); Application.Run(f); }
private void button1_Click(object sender, EventArgs e) { appendText("[System]Connecting..."); if (DanmuManager.getInstance().connect(textBox1.Text.ToString())) { appendText("[System]Connect success"); button1.Enabled = false; button2.Enabled = true; } else { appendText("[System]Connect fail"); button1.Enabled = true; button2.Enabled = false; } }
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); DanmuManager.getInstance().closeSocket(); System.Environment.Exit(0); }