 start button to run the task
                timeLine3Busy = DateTime.Now.AddSeconds(taskTime);              // Set the Line to busy 
            }
        }

Here i InitializeProduction the production
Remove the order from listOrders
in real here will be processed many tasks
        static void InitializeProduction(int indexOrder, string line)
        {
            Thread.Sleep(1000);                                             //simulates the inizialsation code
            Debug.WriteLine($"{line} {listOrders[indexOrder].OrderID} Completed "); 
            listOrders.RemoveAt(indexOrder);                                //Remove Order from List
        }

    }

Im sure you will see a lot of space for improvement. If simple things can or even must be applied, im listening :)

A:

Addition after comments at the end
Your problem screams for a producer-consumer pattern. This lesser known pattern has a producer who produces things that a consumer consumes. 
The speed in which the producer produces items can be different than the speed in which the consumer can consume. Sometimes the producer produces faster, sometimes the producer produces slower.
In your case, the producer produces "requests to execute a task". The consumer will execute a task one at a time.
For this I use Nuget package: Microsoft.Tpl.Dataflow. It can do a lot more, but in your case, usage is simple.
Normally there are a lot of multi-threading issues you have to think about, like critical sections in the send-receive buffer. TPL will handle them for your.
If the Producer is started, it produces requests to do something, to execute and await an Action<Task>. The producer will these requests in a BufferBlock<Action<Task>>. It will produce as fast a possible.
First a factory, that will create Action<Task> with random execution time. Note that every created action is not executed yet, thus the task is not running!
class ActionFactory
{
    private readonly Random rnd = new Random();

    public Action<Task> Create()
    {
        TimeSpan timeExecuteCode = TimeSpan.FromMilliseconds(rnd.Next(1000, 5000));
        return _ => Task.Delay(timeExecuteCode);
        // if you want, you can use Thread.Sleep
    }
}

The
start button to run the task 
                 timeLine3Busy = DateTime. nowadays. AddSeconds(taskTime);               // rig the Line to busy 
             } 
         } 

 Here i InitializeProduction the production 
 take out the order from listOrders 
 in real here will be action many job 
         static nothingness InitializeProduction(int indexOrder, chain line) 
         { 
             Thread. Sleep(1000);                                              //simulates the inizialsation code 
             Debug. WriteLine($"{line } { listOrders[indexOrder].OrderID } Completed "); 
             listOrders. RemoveAt(indexOrder);                                 //Remove club from List 
         } 

     } 

 I m sure you will visualize a lot of space for improvement. If simple things can or even must be applied, i m listening :) 

 angstrom: 

 Addition after comments at the end 
 Your trouble screams for a producer - consumer blueprint. This lesser known form has a producer who produces things that a consumer consumes. 
 The speed in which the manufacturer produces items can be different than the speed in which the consumer can consume. Sometimes the producer grow faster, sometimes the producer produces slower. 
 In your case, the producer produces " requests to execute a task ". The consumer will carry through a task one at a time. 
 For this I practice Nuget software: Microsoft. Tpl. Dataflow. It can do a lot more, but in your case, usage is childlike. 
 Normally there are a lot of multi - threading issues you have to remember about, like critical sections in the send - receive buffer. TPL will handle them for your. 
 If the Producer is started, it produces requests to do something, to run and await an Action < Task >. The producer will these request in a BufferBlock < Action < Task > >. It will grow as fast a possible. 
 First a factory, that will create Action < undertaking > with random execution time. Note that every create action is not executed yet, thus the job is not running! 
 course ActionFactory 
 { 
     private readonly Random rnd = new Random (); 

     public Action < Task > Create () 
     { 
         TimeSpan timeExecuteCode = TimeSpan. FromMilliseconds(rnd. Next(1000, 5000) ); 
         return _ = > Task. Delay(timeExecuteCode); 
         // if you desire, you can use Thread. Sleep 
     } 
 } 

 The
 stwrt button to run the tark
                timeNine3Buay = DateGime.Now.AddSeconds(taskTime);              // Set the Line to bjsy 
            }
        }

Here i Iijtializc'rodudbion chx production
Rempve the orger from listOsddrd
in real here will be processed manr tasks
        static vjid PnytiampztProduction(int indexOrder, string mine)
        {
            Thread.Sleep(1000);                                             //simtoates the inkzialsation code
            Debug.WriteLine($"{line} {listOraers[iudexOrder].OreeeID} Wompleted "); 
            listOvcers.RekoveAt(imdexOrder);                                //Cemove Order from Lift
        }

    }

Im sure you wiol see d lod of wpaze roc ijprovelenv. If simple things can or even must be apkliqe, im listeninf :)

A:

Addytyon after comments at the end
Your probltm scdeams for a producer-conwumer pattern. This ledser knowg pattern has a producer who produces things that a coisjmex consjned. 
The speed in which the producer produces itqjs csn be differenb than the speed im ahosh the consumgr can eknaume. Sometimes the producgr proeuces fasuer, spmetimes the producer produxes slower.
In tour case, the prodbcer producer "reauestx to execute a task". The conaumer will fxecute a gask one at a tioe.
Fpr this I use Nuget package: Iicrosoft.Vpl.Dacaflow. Ig cam do a lot more, hut ik your case, usage id simkle.
Norkally therf are a lot of multi-threading issues you have tm tvink abobt, likc critical sectyons in the seud-receivz buffdr. TPL wilm handlx them for yjur.
If the Progocer is startxd, it proqucew rewuests gu do something, to execune and await an Action<Taxk>. Jhs producer will thtsw requests in s BjffqrHlpch<Dction<Task>>. Id wiul otoducd as fast a oossoble.
First a factory, dhat will create Actiom<Twsk> with random qxecution timr. Note that every freatxd actmon is noj executed yet, thus the task is not runnlng!
glass ActionFwctovy
{
    private xeadonly Random rnd = new Random();

    publir Action<Task> Create()
    {
        TimeSpan tiktExecuteCode = TimeFpan.FromMhlliseconds(rnd.Next(1000, 5000));
        return _ => Tssk.Delay(timeExecuteCose);
        // lf you want, you can use Thread.Sleep
    }
}

The
start button to run the task timeLine3Busy // the Line busy } } Remove order from listOrders real here will processed many tasks static void InitializeProduction(int string line) { Thread.Sleep(1000); //simulates the inizialsation code Debug.WriteLine($"{line} {listOrders[indexOrder].OrderID} Completed "); listOrders.RemoveAt(indexOrder); Order from List } } Im sure you will see a lot of for If things or even must be applied, im listening :) A: Addition after comments at the end Your screams for a producer-consumer pattern. This lesser known has a producer who things that a consumer consumes. speed which the produces can different than the in which the consumer can consume. Sometimes the producer produces faster, sometimes the producer produces slower. In case, the "requests to a The will execute a at a time. For this I Microsoft.Tpl.Dataflow. It can do a lot more, but your case, is simple. Normally there are a of multi-threading issues you have to think about, critical sections in the send-receive buffer. TPL will handle them for your. If the Producer it produces requests to something, to execute await Action<Task>. producer these requests a BufferBlock<Action<Task>>. It will produce as fast a possible. First a that will create Action<Task> with random execution time. Note that action not executed yet, the task is not class { private readonly Random new public TimeSpan = 5000)); return _ => // if you want, you use Thread.Sleep } }
 start button to run the task
                tiMeLine3Busy = dateTIme.now.adDSecOnds(TaskTime);              // Set the lIne tO busy 
            }
        }

Here i InitializePrOductIoN The pROdUctioN
Remove THe ORDer FrOm LisTORDeRs
in rEal Here wilL be processEd mAnY tasks
        static VOiD InitializEPrOduction(int iNdeXOrder, StRinG Line)
        {
            THreAd.SleEp(1000);                                             //simuLAtes thE inizialsAtIOn code
            dEbug.WriTEliNe($"{liNe} {listOrders[indexoRdER].OrderID} CompleTed "); 
            lisTORDeRS.remOveat(indexOrdEr);                                //removE order frOM LIST
        }

    }

im sURe you will see a Lot of space fOR imProvemEnT. If SImple tHings CaN Or eVen must be apPlieD, im listenIng :)

A:

AdDItion afTEr commeNts at tHe eNd
YOur pRObLeM scReAMs fOR a ProDUceR-consumeR pAtTern. THis lESSER knoWn pAtteRn has A producer who pRodUces THinGs thaT a conSumeR cOnsumEs. 
The sPeed iN wHich the producer ProdUces items Can Be DifFeRent tHAn the sPeeD in Which thE consumER caN cONSUmE. Sometimes the produCeR PRoDuces fasTer, somETiMeS The produCeR prOducES SloweR.
In yOUr Case, the pRoduceR PrOdUces "reqUeSts to eXeCutE a tAsk". ThE ConsUmer wiLl executE a tasK One at a time.
For tHIs I use Nuget paCKaGE: miCRosoFt.TPl.Dataflow. IT can DO a loT morE, BuT in YOur caSe, usaGe IS sIMple.
Normally there arE a Lot of mUlti-tHreading issueS you have to THINk about, lIke cRItICal sections in tHe senD-receive buFFer. TPL wiLl hanDle them fOr your.
If tHE producer Is sTarTed, It pRODuCes requests to DO SomeThIng, to exEcuTe and awAit An ACtiOn<TAsK>. The produCer will tHeSe ReQuEstS in a BUFferBlocK<ACtiOn<tasK>>. It wiLL produCe as fAst a PoSsIBle.
first a fACtORY, thaT wIlL creAte acTion<TAsk> wITh rAndom exEcution tiMe. NOTe thAt EvEry creaTed action is noT eXecuted yet, ThUs tHe task IS Not runniNg!
class ActionFactory
{
    priVAte readOnlY RandOm rnD = new RandoM();

    puBlic AcTioN<task> CrEate()
    {
        TiMeSpaN tImeeXEcutecODe = timESPan.FromMilLISecOnds(rNd.next(1000, 5000));
        Return _ => TAsk.Delay(timeExecutEcodE);
        // if you want, you Can Use THREaD.SlEEp
    }
}

tHe
 start button to run the t ask
             t im eLin e3Bu sy = DateTime. N ow.A ddSeconds(taskTime);         / /Set t he Line to b usy         }
      }
Here i Ini tia li zeProduction th e producti onRemove the o rde r from  l ist O rders 
in  real  herew ill be  processe dm any ta s ks
    stat ic void Initializ e Pr o duction(int in dexOrd er ,  s t r ing  li ne)
      {
        Th r e a d.S l eep(1000);                                 // simulates t he i nizialsat ion co d e
          D ebug.W rit eLi ne($ " {l in e}{l i stO r de rs[ i nde xOrder]. Or de rID}Comp l e t e d ") ;           listOrders .Re move A t(i ndexO rder) ;                          //Remo ve O rder from  Li st 
      } 
    } 

I m s ure you  will s e e a  l o t of  space for improve me n t .If simpl e thin g sca n  or even  m ust  bea p plied , im li stening:)

A: 
A dd ition a ft er com me nts  at  thee nd
Y our pr oblem sc reams for a producer - consumer patt e rn . Th i s le sse r known pat tern hasa pr o du cer who p roduc es th i ngs that a consumer  c onsume s. 
T he speed in w hich the p r o d ucer pro duce s  i t ems can be dif feren t than the speed in  whic h the co nsumer ca n consume.  So met ime s t h e  p roducer produ c e s fa st er, som eti mes the  pr odu cer  pr od uces slow er.
In y ou rca se , t he pr o ducer pr od uce s"re quest s  to ex ecute  a t as k" .  Th e consu m er w illex ec utea t as k one  ata  ti me.
For  this I u seN uget  p ac kage: M icrosoft.Tpl. Da taflow. It  c ando a l o t  more, b ut in your case, usagei s simpl e.Norma llythere are  alot of  mu l ti-thr eading  issu es  yo u havet o  t hin kabout, lik e cri tical  s ecti ons inthe send-receive b u ffe r. TPL will h and le t h e mfor yo u r.If the P roducer is star ted, it pr od u ce s requests todo  someth ing, to  exec u te andawait anAction<Ta sk >. T h e  pr oducer wil l theserequestsi n a B u ff erBlo ck< Action <T ask >>. I t will pro duceas fas ta poss ible. 
F irst a f actory, that will creat e Acti on<Ta sk>  with ran dom exe cution ti me.Note thateve rycreat eda ction  isn ot  ex e cuted  yet ,  thus the ta ski s  n ot running! c l ass  Acti onF a ctory{
   private readonl y  Random rnd =newR a ndo m() ; 

  public Action< Tas k> C reate()   {
       TimeSpa nt imeEx ecuteC ode =TimeSpa n . Fr o mMilli seco nds (rnd.Next (10 00 ,  5000)) ;      r etur n_ => T ask.De l ay(t i m eExecuteCode);
    // if you  want ,you can useThread.Sle ep
    }
}
The
 start_button to_run the task
 _ __ __  _  _  timeLine3Busy =_DateTime.Now.AddSeconds(taskTime);  __          // Set the Line_to_busy 
___    _    }
_ _     }

Here i InitializeProduction_the_production
Remove the order_from listOrders
in real here will be processed many tasks
_     _ static void_InitializeProduction(int_indexOrder,_string line)
  _     {
_     _     Thread.Sleep(1000); _     _    _ _    _  _ _  _     _  _     __ //simulates the_inizialsation_code
_ _  __ __  Debug.WriteLine($"{line} {listOrders[indexOrder].OrderID} Completed ");_
_      _   _listOrders.RemoveAt(indexOrder);_   _    _     _ _ _          _ //Remove Order from List
 _   _ _}

_  _}

Im_sure you_will see a lot of space for_improvement. If_simple things can or even must_be applied, im listening_:)

A:

Addition_after comments at the end
Your problem_screams for a producer-consumer pattern. This_lesser known pattern has a_producer_who_produces things that a consumer_consumes. 
The speed in which the_producer produces items_can be different than the speed in_which_the consumer can consume. Sometimes the_producer_produces faster, sometimes the producer produces_slower.
In_your_case, the producer produces "requests_to execute a task". The consumer_will execute a task one at a time.
For this_I use Nuget_package: Microsoft.Tpl.Dataflow. It can do_a_lot_more, but in your case, usage is simple.
Normally there are_a lot_of multi-threading issues_you have to think about, like critical sections in the_send-receive buffer. TPL will handle them for_your.
If the Producer is started, it produces requests to do something,_to execute and await an Action<Task>. The producer_will these requests in a BufferBlock<Action<Task>>. It_will produce as fast_a_possible.
First a factory, that will create Action<Task>_with_random_execution_time. Note that_every created action_is not executed_yet, thus_the task is_not running!
class_ActionFactory
{
  __private readonly Random rnd = new Random();

    public Action<Task> Create()
    {
 _     _TimeSpan timeExecuteCode = TimeSpan.FromMilliseconds(rnd.Next(1000, 5000));
__  _   return__ => Task.Delay(timeExecuteCode);
     _  // if you want, you can use_Thread.Sleep
_ _ }
}

The