示例#1
0
 public StepQueue Add(StepQueue item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("step");
     }
     item.QueueId = _nextId++;
     steps.Add(item);
     return(item);
 }
示例#2
0
        public bool Update(StepQueue item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            int index = steps.FindIndex(p => p.QueueId == item.QueueId);

            if (index == -1)
            {
                return(false);
            }
            steps.RemoveAt(index);
            steps.Add(item);
            return(true);
        }