示例#1
0
        private void QueueUploaders()
        {
            int sequence = 1;

            foreach (var item in ToolkitUtilities.GetPreorder <LocalTaxonomyItem>(this.localTermStore, x => x.ChildItems)
                     )
            {
                this.CheckForUnimplementedSyncActions(item);

                TaxonomyItemUploader uploader = this.CreateUploader(item);

                if (uploader == null)
                {
                    continue;
                }

                uploader.ControllerKey.Started = false;
#if false
                // FOR DEBUGGING, BLOCK AS MUCH AS POSSIBLE
                uploader.ControllerKey.Sequence = -sequence;
#else
                uploader.ControllerKey.Sequence = sequence;
#endif
                ++sequence;
            }

            foreach (var uploader in this.queuedUploaders.EnumerateUnordered())
            {
                uploader.Initialize();
            }
        }
示例#2
0
 protected void WaitForBlocker(TaxonomyItemUploader blocker)
 {
     if (this.blockers.Contains(blocker))
     {
         throw new InvalidOperationException("Invalid call to StartWaiting()");
     }
     this.blockers.Add(blocker);
     blocker.waiters.AddLast((TaxonomyItemUploader)this);
 }
示例#3
0
 internal void NotifyUploaderUnblocked(TaxonomyItemUploader uploader)
 {
     // If the uploader was added to the blockedUploaders set, then remove it.
     // It's possible that it was blocked and unblocked before the controller saw it,
     // in which case it won't be in the set.
     if (this.blockedUploaders.Remove(uploader))
     {
         // If we found it, put it back in the queue
         this.queuedUploaders.Add(uploader);
     }
 }