BclExtras.Threading.ProgressTrackerProxy.ShowTrackerBlocking C# (CSharp) Method

ShowTrackerBlocking() private method

private ShowTrackerBlocking ( ) : void
return void
        internal void ShowTrackerBlocking()
        {
            lock (m_lock)
            {
                if (m_finished)
                {
                    return;
                }

                m_tracker = m_factory.CreateProgressTracker();
                m_tracker.Canceled += new EventHandler(this.OnTrackerCanceled);
            }

            // Do the initial update
            UpdateTracker();

            try
            {
                // Call this out side the lock since Display is allowed to block.
                // Also catch errors because there is a race condition that can
                // cause m_tracker to be destroyed before being displayed.
                m_factory.Display(m_tracker);
            }
            catch (Exception ex)
            {
                Logger.Trace("Error caught while displaying ProgressTracker", ex);
            }
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Show the progress tracker blocking.  This will return when the operation completes
 /// </summary>
 public void ShowTrackerBlockingEmpty()
 {
     m_proxy.ShowTrackerBlocking();
     WaitEmpty();
 }