private void btn_led_Click(object sender, EventArgs e) { //MessageBox.Show(Application.StartupPath.ToString()); List <ScreenLEDEntity> listled = ScreenLedFactory.GetAllLed(); foreach (ScreenLEDEntity LEDen in listled) { string[] str = new string[] { "", LEDen.SCREENNAME, LEDen.IPADDRESS, LEDen.PORT, LEDen.WIDTH.ToString(), LEDen.HEIGHT.ToString(), LEDen.CONTROLER, LEDen.SCREENTYPE, LEDen.POSITION, LEDen.STATUS, LEDen.LASTUPDATE.ToString(), LEDen.CADDRESS.ToString() }; ListViewItem Item = new ListViewItem(str); //(0 is green )(1 is yellow)(2 is red) if (LEDen.STATUS == "0") { Item.ImageIndex = 2; } else if (LEDen.STATUS == "1") { Item.ImageIndex = 1; } else { Item.ImageIndex = 0; } ledView.Items.Add(Item); } //this.OpenLed(); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); //if (IPS.Contains("192.168.113.73")) // this.SendLed("192.168.113.73"); List <ScreenLEDEntity> listscreen = ScreenLedFactory.GetAllLed(); foreach (ScreenLEDEntity screen in listscreen) { if (IPS.Contains(screen.IPADDRESS)) { this.SendLed(screen.IPADDRESS); } } timer1.Start(); }