Ejemplo n.º 1
0
        public async Task InitRecruitmentQueue(string userId)
        {
            _unitQueue = await _viewService.GetUnitQueueById(userId);

            _unitQueue.Queue.Sort((x, y) => DateTime.Compare(x.FinishTime, y.FinishTime));

            UnitQueueData previousItem = null;

            foreach (var item in _unitQueue.Queue)
            {
                TimeSpan tmp;

                if (previousItem != null)
                {
                    tmp = item.FinishTime - previousItem.FinishTime;
                }

                else
                {
                    tmp = item.FinishTime - DateTime.Now;
                }

                item.RecruitTime = new TimeSpan(tmp.Hours, tmp.Minutes, tmp.Seconds);
                previousItem     = item;
            }

            NotifyStateChanged();
        }
Ejemplo n.º 2
0
 public void AddToQueue(UnitQueueData entry)
 {
     _unitQueue.Queue.Add(entry);
     Timer.Start();
     NotifyStateChanged();
 }