private void ViewerForm_Load(object sender, EventArgs e) { pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; ServerConnect.EventImageRecieved += ViewerForm_UpdatePicture; ServerConnect.parentForm = this; this.Capture = true; new Task(() => ServerConnect.Listen()).Start(); }
private void btnConnect_Click(object sender, EventArgs e) { ServerConnect.Connect(tbIPAdress.Text, Int32.Parse(tbPort.Text)); if (ServerConnect.netStream != null) { this.Hide(); new ViewerForm(this).ShowDialog(); } }
private void CeaseConnection() { ServerConnect.isOnline = false; ServerConnect.Disconnect(new ServerErrorHandler("Could not cease connection. Please terminate it manually")); }