private void EstadoZonaWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { EstadoZona_timer.Start(); } catch (ArgumentNullException) {} }
private void MainScreenForm_Load(object sender, EventArgs e) { try { color = Color.Transparent; RefrescarTimer.Start(); LLenarFacpCB(); facp_cb.Text = Properties.Settings.Default.SelectedFacp; ObtenerZonasHabilitadas(); UpdateZonaEstatus(); ObtenerUltimoEstadoFacp(); ObtenerEstadoEvacuacionFacp(); EstadoZona_timer.Start(); //obtenerEstadoFacp(); getIfModuleOnline(); CheckIfSoftwareActivated(); } catch (ArgumentNullException) { } }
public void ObtenerZonasHabilitadas() { try { this.Invoke((MethodInvoker) delegate { if (facp_cb.SelectedIndex != -1) { int sizex = 195; int sizey = 195; DataTable dt = new DataTable(); Procedimientos P = new Procedimientos(); P.ID_FACP = Convert.ToInt32(facp_cb.SelectedValue); Program.GidFacp = Convert.ToInt32(facp_cb.SelectedValue); dt = P.ObtenerZonasHabilitadas(); int panelHeight = flowLayoutPanel1.Height; int panelWidth = flowLayoutPanel1.Width; int total = dt.Rows.Count; if (total == 1) { sizey = (panelHeight) - 10; sizex = (panelWidth) - 10; } else if (total == 2) { sizey = (panelHeight) - 10; sizex = (panelWidth / total) - 10; } //else if (total == 3 ) //{ // sizey = (panelHeight) - 10; // sizex = (panelWidth/3) - 10; //} else { sizey = (panelHeight / 2) - 10; sizex = (panelWidth / 2) - 10; } for (int i = dt.Rows.Count - 1; i > -1; i--) { int idZona = Convert.ToInt32(dt.Rows[i][0]); string nombre = dt.Rows[i][1].ToString(); string Descripcion = dt.Rows[i][2].ToString(); byte[] imgshow = (byte[])(dt.Rows[i][3]); string FACP = dt.Rows[i][4].ToString(); MemoryStream Ms = new MemoryStream(imgshow); try { GenerarThumbnailZonas(idZona, nombre, Descripcion, Ms, FACP, sizex, sizey); } catch (Exception ex) { //Console.WriteLine("MAIN SCREEN OBTENER ZONAS HABILITADAS"); RefrescarTimer.Start(); EstadoZona_timer.Start(); } } } }); } catch (ArgumentNullException ex) { } }