private void UpdateList() { itemList.Clear(); itemList.AddItems(vendorContent.Count); for (int i = 0; i < vendorContent.Count; i++) { VendorItemEntry item = itemList.Entries[i] as VendorItemEntry; item.SetItem(vendorContent[i], this); } }
/// <summary> /// Clear all items and send new vendor state to clients UI /// </summary> private void UpdateAllItemsView() { if (!vendor) { return; } // remove all items UI itemList.Clear(); var vendorContent = vendor.VendorContent; itemList.AddItems(vendorContent.Count); // update UI for clients for (int i = 0; i < vendorContent.Count; i++) { VendorItemEntry item = itemList.Entries[i] as VendorItemEntry; item.SetItem(vendorContent[i], this); } }