private void btnCast_Click(object sender, EventArgs e) { if (HTTPCast.IsCasting) { HTTPCast.StopCasting(); } else if (WebCast.IsCasting) { WebCast.StopCasting(); } else { CastDialog cd = new CastDialog(control); cd.ShowDialog(); } CloseMenu?.Invoke(); }
private async void btnWebStart_Click(object sender, EventArgs e) { tbWebHostname.Enabled = false; tbWebId.Enabled = false; btnWebStart.Enabled = false; tbWebHostname.Text = WebCast.GetHost(tbWebHostname.Text); int connectionActive = await WebCast.StartCasting(tbWebHostname.Text, tbWebId.Text, ink); if (connectionActive == 0) { this.Close(); } else if (connectionActive == 1) { MsgBox.ShowOk("Cast.web.rejected"); } else { MsgBox.ShowOk("Cast.web.connectionError"); } tbWebHostname.Enabled = true; tbWebId.Enabled = true; btnWebStart.Enabled = true; }