internal void RaiseItemClicked(CompletionListItem item) { if (ItemClicked != null) { ItemClicked(item); } }
public void Add(CompletionListItem itemToAdd) { if (itemToAdd.ShouldShow(CurrentList) && !DuplicateHash.Contains(itemToAdd.Text) ) { lstItems.Items.Add(itemToAdd); DuplicateHash.Add(itemToAdd.Text); } }
protected override Image GetIconForItem(int index) { if (index < 0 || index >= this.Items.Count) { return(null); } CompletionListItem item = this.Items[index] as CompletionListItem; if (item == null) { return(null); } return(item.Picture); }
/// <summary> /// Selects the first matching item found, /// that has text starting with matchBeginning /// </summary> /// <param name="matchBeginning">Beginning of the item text</param> public void SelectItem(string matchBeginning) { matchFound = false; for (int i = 0; i <= lstItems.Items.Count - 1; i++) { CompletionListItem CurrentItem = lstItems.Items[i] as CompletionListItem; if (CurrentItem.Text.StartsWith(matchBeginning, CurrentList.TextComparison)) { lstItems.SelectedIndex = i; matchFound = true; return; } } lstItems.SelectedIndex = -1; }
private void PerformClick(ItemClickReason reason) { using (Redrawer r = new Redrawer(CurrentList.HostBlock.Root)) { CompletionListItem ActiveItem = GetActiveItem(); HideList(); if (ActiveItem != null && matchFound) { ActiveItem.Reason = reason; ActiveItem.Click(CurrentList); if (CurrentList != null) { CurrentList.RaiseItemClicked(ActiveItem); } } } }
public void Add(CompletionListItem item) { Items.Add(item); }