Esempio n. 1
0
 internal void GetSchedulerToProcessTasks()
 {
     while (scheduler.ProcessNextTask(false))
     {
         // Continue too run till tasks are exhausted.
     }
 }
Esempio n. 2
0
        /// <summary>
        /// When Revit goes idle it gets here and process all tasks in the scheduler
        /// queue. The control returns to Revit only when all tasks are processed.
        /// This method will be called again the next time Revit goes into idle state.
        /// </summary>
        /// <param name="sender">Reference to the current Revit application.</param>
        /// <param name="e">Idling event argument.</param>
        ///
        private void OnRevitIdle(object sender, IdlingEventArgs e)
        {
            const bool waitIfTaskQueueIsEmpty = false;

            while (scheduler.ProcessNextTask(waitIfTaskQueueIsEmpty))
            {
                // Does nothing here, loop ends when all tasks processed.
            }
        }