private void LoadSelectedSlot(SlotModel selectedSlot, WorkUnitQueue workUnitQueue, SlotType slotType, IList <LogLine> logLines) { queueControl.SetWorkUnitQueue(workUnitQueue, slotType); txtLogFile.SetLogLines(selectedSlot, logLines); if (_presenter.Model.FollowLog) { txtLogFile.ScrollToBottom(); } }
private static ICollection <ListItem> CreateEntryNameCollection(WorkUnitQueue workUnitQueue) { return(workUnitQueue .Select(x => new ListItem(FormatDisplay(x), x.ID)) .ToList()); string FormatDisplay(WorkUnitQueueItem workUnit) { return(String.Format(CultureInfo.InvariantCulture, "{0:00} - {1}", workUnit.ID, workUnit.ToShortProjectString())); } }
public void SetWorkUnitQueue(WorkUnitQueue workUnitQueue, SlotType slotType) { if (workUnitQueue != null) { _workUnitQueue = workUnitQueue; _slotType = slotType; cboQueueIndex.SelectedIndexChanged -= cboQueueIndex_SelectedIndexChanged; cboQueueIndex.DataSource = CreateEntryNameCollection(_workUnitQueue); cboQueueIndex.DisplayMember = nameof(ListItem.DisplayMember); cboQueueIndex.ValueMember = nameof(ListItem.ValueMember); cboQueueIndex.SelectedIndex = -1; cboQueueIndex.SelectedIndexChanged += cboQueueIndex_SelectedIndexChanged; cboQueueIndex.SelectedValue = _workUnitQueue.CurrentQueueID; } else { _workUnitQueue = null; _slotType = SlotType.Unknown; SetControlsVisible(false); } }