private bool IsSolutionExistsAndNotDebuggingAndNotBuilding()
        {
            int pfActive;
            int result = VsMonitorSelection.IsCmdUIContextActive(_solutionNotBuildingAndNotDebuggingContextCookie, out pfActive);

            return(result == VSConstants.S_OK && pfActive > 0);
        }
예제 #2
0
        private bool ShouldMEFBeInitialized()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (!_initialized)
            {
                var hr = VsMonitorSelection.IsCmdUIContextActive(
                    _solutionExistsCookie, out var pfActive);

                return(ErrorHandler.Succeeded(hr) && pfActive > 0);
            }

            return(false);
        }
예제 #3
0
        private bool IsSolutionExistsAndNotDebuggingAndNotBuilding()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var hr = VsMonitorSelection.IsCmdUIContextActive(
                _solutionExistsAndFullyLoadedContextCookie, out var pfActive);

            if (ErrorHandler.Succeeded(hr) && pfActive > 0)
            {
                hr = VsMonitorSelection.IsCmdUIContextActive(
                    _solutionNotBuildingAndNotDebuggingContextCookie, out pfActive);

                return(ErrorHandler.Succeeded(hr) && pfActive > 0);
            }

            return(false);
        }
예제 #4
0
        private bool IsIDEInDebuggingOrBuildingContext()
        {
            int pfActive;
            int result = VsMonitorSelection.IsCmdUIContextActive(_debuggingContextCookie, out pfActive);

            if (result == VSConstants.S_OK && pfActive > 0)
            {
                return(true);
            }

            result = VsMonitorSelection.IsCmdUIContextActive(_solutionBuildingContextCookie, out pfActive);
            if (result == VSConstants.S_OK && pfActive > 0)
            {
                return(true);
            }

            return(false);
        }