EnsureProcessingComplete() private method

Makes sure all pending changes are processed and applied to the tree
private EnsureProcessingComplete ( ) : void
return void
Example #1
0
        /// <summary>
        /// Ensures tree is up to date, matches current text buffer snapshot
        /// and all changes since the last update were processed. Blocks until
        /// all changes have been processed. Does not pump messages.
        /// </summary>
        public void EnsureTreeReady()
        {
            if (TreeUpdateTask == null)
            {
                return;
            }

            if (_ownerThread != Thread.CurrentThread.ManagedThreadId)
            {
                throw new ThreadStateException("Method should only be called on the main thread");
            }

            // OK to run in sync if changes are pending since we need it updated now
            TreeUpdateTask.EnsureProcessingComplete();
        }