public void HandleArmStatusChange(ArmStatusVector v) { RunOnGUIThread(this, () => { foreach (int i in m1.getConfiguredAreas()) { String areaname = ""; try { areaname = m1.getTextDescription(TextDescriptionType.TEXT_AreaName, i); } catch { // ... } if (String.IsNullOrEmpty(areaname)) { areaname = "Area " + (i + 1); } ListViewItem Item = (AreasList.Items.ContainsKey(i.ToString())) ? AreasList.Items.Find(i.ToString(), false)[0] : AreasList.Items.Add(new ListViewItem { Name = i.ToString() }); switch (v[i].mode) { case ArmMode.ARM_AWAY: case ArmMode.ARM_AWAYNEXT: case ArmMode.ARM_VACATION: Item.Text = areaname; Item.ImageKey = "armaway"; break; case ArmMode.ARM_DISARMED: Item.Text = areaname; Item.ImageKey = "disarm"; break; case ArmMode.ARM_NIGHT: case ArmMode.ARM_NIGHTINSTANT: Item.Text = areaname; Item.ImageKey = "armnight"; break; case ArmMode.ARM_STAY: case ArmMode.ARM_STAYINSTANT: case ArmMode.ARM_STAYNEXT: Item.Text = areaname; Item.ImageKey = "armstay"; break; } } }); }
public override void run(ArmStatusVector status) { lamb(status); }