예제 #1
0
        private async Task BuildVillages()
        {
            BuildWorker    BW     = new BuildWorker();
            List <Village> villgs = await BW.BuildVillages(Villages);

            Villages = villgs;
            UpdateVillageList(Villages); // is good here?
        }
예제 #2
0
 BuildWorker GetFreeWorker()
 {
     lock (freeWorkers) {
         if (freeWorkers.Count != 0)
         {
             BuildWorker w = freeWorkers[freeWorkers.Count - 1];
             freeWorkers.RemoveAt(freeWorkers.Count - 1);
             w.MarkAsInUse();
             return(w);
         }
     }
     return(new BuildWorker(this));
 }
예제 #3
0
        public void RunBuildJob(BuildJob job, IMSBuildChainedLoggerFilter loggerChain, Action <bool> reportWhenDone, CancellationToken cancellationToken)
        {
            if (job == null)
            {
                throw new ArgumentNullException("job");
            }
            if (loggerChain == null)
            {
                throw new ArgumentNullException("loggerChain");
            }
            BuildWorker worker = GetFreeWorker();

            worker.RunJob(job, loggerChain, reportWhenDone, cancellationToken);
        }