/// <summary> /// Inserts a JumpList item at the top of the category. If the category is already full, /// the bottom item will be removed. /// </summary> /// <param name="item">The item to insert into the JumpList.</param> public void InsertJumpListItem(IJumpListItem item) { // If the item is already on the jumplist, remove it first. RemoveJumpListItem(item.Path); if (MaxItems > 0 && JumpListItems.Count >= MaxItems) { JumpListItems.Remove(JumpListItems[JumpListItems.Count - 1]); } JumpListItems.Insert(0, item); }
public void RemoveJumpListItem(string path) { List <IJumpListItem> itemsToRemove = new List <IJumpListItem>( from i in JumpListItems where string.Equals(path, i.Path, StringComparison.OrdinalIgnoreCase) select i); // Remove matching items for (int i = 0; i < itemsToRemove.Count; i++) { JumpListItems.Remove(itemsToRemove[i]); } }
internal void RemoveJumpListItem(string path) { List <IJumpListItem> itemsToRemove = new List <IJumpListItem>(); // Check for items to remove foreach (IJumpListItem item in JumpListItems) { if (string.Compare(path, item.Path, true) == 0) { itemsToRemove.Add(item); } } // Remove matching items for (int i = 0; i < itemsToRemove.Count; i++) { JumpListItems.Remove(itemsToRemove[i]); } }