private void Controller()
        {
            while (_pendingPublishOperations.Count > 0)
            {
                PublishOperation operation = _pendingPublishOperations.Dequeue();

                if (operation is PublishContentOperation)
                {
                    MainForm.WriteTrace("Scheduling content for: {0}", operation.LocalSite.SiteName);
                    ThreadPool.QueueUserWorkItem(new WaitCallback(PublishContent), operation);
                }
                else if (operation is PublishDbOperation)
                {
                    MainForm.WriteTrace("Scheduling db for: {0}", operation.LocalSite.SiteName);
                    ThreadPool.QueueUserWorkItem(new WaitCallback(PublishDatabase), operation);
                }
            }
        }
 internal void Enqueue(PublishOperation operation)
 {
     MainForm.WriteTrace("Enqueueing {0}", operation.LocalSite.SiteName);
     // no contention since enqueueing happens before processing has started
     _pendingPublishOperations.Enqueue(operation);
 }
 internal void Enqueue(PublishOperation operation)
 {
     MainForm.WriteTrace("Enqueueing {0}", operation.LocalSite.SiteName);
     // no contention since enqueueing happens before processing has started
     _pendingPublishOperations.Enqueue(operation);
 }