Example #1
0
        public static VsWaitLoop TryCreate(string text)
        {
            VsWaitLoop waitLoop = new VsWaitLoop(text);
            if (waitLoop._messagePump == null)
                return null;

            return waitLoop;
        }
Example #2
0
        static public VsWaitLoop TryCreate(string text)
        {
            VsWaitLoop waitLoop = new VsWaitLoop(text);

            if (waitLoop._messagePump == null)
            {
                return(null);
            }

            return(waitLoop);
        }
Example #3
0
 public WaitLoop(string message)
 {
     try
     {
         _vsWaitLoop = VsWaitLoop.TryCreate(message);
     }
     catch (FileNotFoundException)
     {
         // Visual Studio is not installed on this box
     }
 }
Example #4
0
 public WaitLoop(string message)
 {
     try
     {
         _vsWaitLoop = VsWaitLoop.TryCreate(message);
     }
     catch (FileNotFoundException)
     {
         // Visual Studio is not installed on this box
     }
 }
Example #5
0
        /// <summary>
        /// Waits on the specified handle. This method should be called only once.
        /// </summary>
        /// <param name="launchCompleteHandle">[Required] handle to wait on</param>
        /// <param name="cancellationSource">[Required] Object to signal cancellation if cancellation is requested</param>
        /// <returns>true if we were able to successfully wait, false if we failed to wait and should fall back to the CLR provided wait function</returns>
        /// <exception cref="FileNotFoundException">Thrown by the JIT if Visual Studio is not installed</exception>
        public void Wait(WaitHandle launchCompleteHandle, CancellationTokenSource cancellationSource)
        {
            if (_vsWaitLoop != null)
            {
                _vsWaitLoop.Wait(launchCompleteHandle, cancellationSource);

                lock (_progressLock)
                {
                    _vsWaitLoop = null;
                }
            }
            else
            {
                launchCompleteHandle.WaitOne(); // For glass, fall back to waiting using the .NET Framework APIs
            }
        }
Example #6
0
        /// <summary>
        /// Waits on the specified handle. This method should be called only once.
        /// </summary>
        /// <param name="launchCompleteHandle">[Required] handle to wait on</param>
        /// <param name="cancellationSource">[Required] Object to signal cancellation if cancellation is requested</param>
        /// <returns>true if we were able to successfully wait, false if we failed to wait and should fall back to the CLR provided wait function</returns>
        /// <exception cref="FileNotFoundException">Thrown by the JIT if Visual Studio is not installed</exception>
        public void Wait(WaitHandle launchCompleteHandle, CancellationTokenSource cancellationSource)
        {
            if (_vsWaitLoop != null)
            {
                _vsWaitLoop.Wait(launchCompleteHandle, cancellationSource);

                lock (_progressLock)
                {
                    _vsWaitLoop = null;
                }
            }
            else
            {
                launchCompleteHandle.WaitOne(); // For glass, fall back to waiting using the .NET Framework APIs
            }
        }