コード例 #1
0
ファイル: VsWaitLoop.cs プロジェクト: rajkumar42/MIEngine
        static public VsWaitLoop TryCreate(string text)
        {
            VsWaitLoop waitLoop = new VsWaitLoop(text);
            if (waitLoop._messagePump == null)
                return null;

            return waitLoop;
        }
コード例 #2
0
ファイル: VsWaitLoop.cs プロジェクト: optikos/MIEngine
        static public VsWaitLoop TryCreate(string text)
        {
            VsWaitLoop waitLoop = new VsWaitLoop(text);

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

            return(waitLoop);
        }
コード例 #3
0
ファイル: HostWaitLoop.cs プロジェクト: optikos/MIEngine
 public HostWaitLoop(string message)
 {
     try
     {
         _vsWaitLoop = VSImpl.VsWaitLoop.TryCreate(message);
     }
     catch (FileNotFoundException)
     {
         // Visual Studio is not installed on this box
     }
 }
コード例 #4
0
ファイル: HostWaitLoop.cs プロジェクト: lsgxeva/MIEngine
 public HostWaitLoop(string message)
 {
     try
     {
         _vsWaitLoop = VSImpl.VsWaitLoop.TryCreate(message);
     }
     catch (FileNotFoundException)
     {
         // Visual Studio is not installed on this box
     }
 }
コード例 #5
0
ファイル: HostWaitLoop.cs プロジェクト: optikos/MIEngine
        /// <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
            }
        }
コード例 #6
0
ファイル: HostWaitLoop.cs プロジェクト: lsgxeva/MIEngine
        /// <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
            }
        }