public static VsWaitLoop TryCreate(string text) { VsWaitLoop waitLoop = new VsWaitLoop(text); if (waitLoop._messagePump == null) return null; return waitLoop; }
static public VsWaitLoop TryCreate(string text) { VsWaitLoop waitLoop = new VsWaitLoop(text); if (waitLoop._messagePump == null) { return(null); } return(waitLoop); }
public WaitLoop(string message) { try { _vsWaitLoop = VsWaitLoop.TryCreate(message); } catch (FileNotFoundException) { // Visual Studio is not installed on this box } }
/// <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 } }