コード例 #1
0
        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;
        }
コード例 #2
0
        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);
            }
        }