public void UpdateQueue() { itemsInQueue.Clear(); itemsInQueue.AddItems(currentProducts.Count); for (int i = 0; i < currentProducts.Count; i++) { GUI_AutolatheQueueItem item = itemsInQueue.Entries[i] as GUI_AutolatheQueueItem; item.Product = currentProducts[i]; item.NumberInQueue = i; item.ReInit(); DisableUpDownButtons(item); } SetProcessAndClearButtonInteractable(); }
//The first entry on list must have its up button disabled, the last down button disabled. private void DisableUpDownButtons(GUI_AutolatheQueueItem item) { //Only one item if (currentProducts.Count == 1) { item.DownButton.SetValueServer("false"); item.UpButton.SetValueServer("false"); } else { if (item.NumberInQueue == 0) { item.UpButton.SetValueServer("false"); } if (item.NumberInQueue == currentProducts.Count - 1) { item.DownButton.SetValueServer("false"); } } }