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