private void addDev_Click(object sender, EventArgs e) { var selForm = new DeviceTypeSelectForm(); selForm.ShowDialog(); BaseDevice dev = selForm.CreatedDevice; selForm.Dispose(); var attr = dev.GetComponentAttribute(); devices.Items.Add(new ListViewItem() { Text = attr.UserFriendlyName, Tag = dev, ImageKey = dev.GetType().Name.ToLower() }); }