public void AddSensorNode(SensorNode item) { if (this.ContainsSensor(item.Sensor)) { return; } OverviewItem oi = null; if (item.Sensor.SensorType == SensorType.Temperature) { oi = new TemperatureOverviewItem(item, this); tempsBoxLayout.Controls.Add(oi); } else if (item.Sensor.SensorType == SensorType.Fan) { oi = new FanOverviewItem(item, this); fanBoxLayout.Controls.Add(oi); } else { oi = new OtherOverviewItem(item, this); otherBoxLayout.Controls.Add(oi); } if (oi != null) { items.Add(oi); } }
public void RemoveItem(OverviewItem item) { if (!items.Contains(item)) { return; } tempsBoxLayout.Controls.Remove(item); fanBoxLayout.Controls.Remove(item); }
public void AddItem(OverviewItem item) { if (items.Contains(item)) { return; } if (item.GetType() == typeof(TemperatureOverviewItem)) { tempsBoxLayout.Controls.Add(item); } else if (item.GetType() == typeof(FanOverviewItem)) { fanBoxLayout.Controls.Add(item); } else if (item.GetType() == typeof(OtherOverviewItem)) { otherBoxLayout.Controls.Add(item); } items.Add(item); }