private void categoryCollectionList_SelectedIndexChanged(object sender, EventArgs e) { if (categoryCollectionList.SelectedItems.Count == 0) { return; } ElementListItem item = (ElementListItem)categoryCollectionList.SelectedItems[0]; descriptionBox.Text = item.Element.Description; ElementNameBox.Text = item.Element.Name; _lastSelectedElement = item; }
private void DisplayCurrentCategory() { categoryCollectionList.Clear(); if (_currentCategory.ParentCategory == null) { CurrentCategoryLabel.Text = "Available categories:"; } else { CurrentCategoryLabel.Text = _currentCategory.Name + ":"; } foreach (BaseElement element in _currentCategory) { ElementListItem item = new ElementListItem(element); item.Text = element.Name; item.ToolTipText = element.Description; categoryCollectionList.Items.Add(item); } }