public void AddItem(ListBoxObject item) { if (!itemList.Contains(item)) { Rectangle location = GetItemSize(currentCount); int fontHeight = (int)(spriteFont.MeasureString("D").Y *DisplayController.uiScale); item.SetLocation(location, fontHeight, currentCount); itemList.Add(item); currentCount++; } SetMaxHeight(); }
public bool AddItemUniqueDisplay(ListBoxObject item) { if (!itemList.Contains(item)) { foreach (ListBoxObject itemIn in itemList) { if (itemIn.displayName == item.displayName) { return(false); } } Rectangle location = GetItemSize(currentCount); int fontHeight = (int)(spriteFont.MeasureString("D").Y *DisplayController.uiScale); item.SetLocation(location, fontHeight, currentCount); itemList.Add(item); currentCount++; SetMaxHeight(); return(true); } return(false); }