예제 #1
0
 public void Clear()
 {
     if (QueueType == "BlockingCollection")
     {
         ProcessBlockingCollection.Clear();
     }
     else
     {
         ProcessList.Clear();
     }
 }
예제 #2
0
 public void OrderByPriority()
 {
     if (QueueType == "BlockingCollection")
     {
         ProcessBlockingCollection.OrderByPriority();
     }
     else
     {
         ProcessList.OrderByPriority();
     }
 }
예제 #3
0
 public IEnumerator GetEnumerator()
 {
     if (QueueType == "BlockingCollection")
     {
         return(ProcessBlockingCollection.GetConsumingEnumerable().GetEnumerator());
     }
     else
     {
         return(ProcessList.GetEnumerator());
     }
 }
예제 #4
0
 public Process Take()
 {
     if (QueueType == "BlockingCollection")
     {
         return(ProcessBlockingCollection.Take());
     }
     else
     {
         return(ProcessList.Take());
     }
 }
예제 #5
0
 public List <Process> GetProcessList()
 {
     if (QueueType == "BlockingCollection")
     {
         return(ProcessBlockingCollection.ToList());
     }
     else
     {
         return(ProcessList);
     }
 }
예제 #6
0
 public void Insert(int index, Process process)
 {
     if (QueueType == "BlockingCollection")
     {
         ProcessBlockingCollection.Insert(index, process);
     }
     else
     {
         ProcessList.Insert(index, process);
     }
 }
예제 #7
0
 public bool Remove(string id)
 {
     if (QueueType == "BlockingCollection")
     {
         return(ProcessBlockingCollection.Remove(id));
     }
     else
     {
         return(ProcessList.Remove(id));
     }
 }
예제 #8
0
 public void Add(Process process)
 {
     if (QueueType == "BlockingCollection")
     {
         ProcessBlockingCollection.Add(process);
     }
     else
     {
         ProcessList.Add(process);
     }
 }
예제 #9
0
 public BaseProcessQueue(string type)
 {
     QueueType = type;
     if (QueueType == "BlockingCollection")
     {
         ProcessBlockingCollection = new ProcessBlockingCollection();
     }
     else
     {
         ProcessList = new ProcessList();
     }
 }