public void AddItem(ListPanelItem item) { item.Index = items.Count; items.Add(item); Controls.Add(item); item.BringToFront(); item.Click += ItemClicked; }
private void ListItemUpdater(ListPanelItem item) { if (item is StoryNameListItem) { StoryNameListItem StItem = item as StoryNameListItem; if (item.Index < listItemStr.Count) { StItem.Story = this.sections[item.SectionIndex].Title; StItem.Text = listItemStr[item.Index]; } } }
public void OnItemSelected(ListPanelItem item) { var newSelection = items.IndexOf(item); if (newSelection == selectedItem) { return; } if (selectedItem != -1) { items[selectedItem].Deselect(); } selectedItem = newSelection; onItemSelected.Invoke(selectedItem); }
private void ItemClicked(object sender, EventArgs e) { ListPanelItem item = sender as ListPanelItem; if (SelectedItem != null) { SelectedItem.Selected = false; } SelectedItem = item; SelectedIndex = item.Index; item.Selected = true; if (ItemClick != null) { ItemClick(this, new ItemClickEventArgs() { Item = item }); } }
private void OnListItemUpdate(ListPanelItem listItem) { TestResultItem testResultItem = (TestResultItem)listItem; TestResult result = GetTestResultAtIndex(listItem.SectionIndex, listItem.IndexInSection); testResultItem.SetTestResult(result); }