VsTeXProject.VisualStudio.Project.ProjectNode.EndBuild C# (CSharp) Method

EndBuild() private method

Lets Visual Studio know that we're done with our design-time build so others can use the build manager.
This method must be called on the UI thread.
private EndBuild ( Microsoft.Build.Execution submission, bool designTime, bool requiresUIThread = false ) : void
submission Microsoft.Build.Execution The build submission that built, if any.
designTime bool This must be the same value as the one passed to .
requiresUIThread bool This must be the same value as the one passed to .
return void
        private void EndBuild(MSBuildExecution.BuildSubmission submission, bool designTime,
            bool requiresUIThread = false)
        {
            IVsBuildManagerAccessor accessor = null;

            if (Site != null)
            {
                accessor = Site.GetService(typeof (SVsBuildManagerAccessor)) as IVsBuildManagerAccessor;
            }

            if (accessor != null)
            {
                // It's very important that we try executing all three end-build steps, even if errors occur partway through.
                try
                {
                    if (submission != null)
                    {
                        Marshal.ThrowExceptionForHR(accessor.UnregisterLoggers(submission.SubmissionId));
                    }
                }
                catch (Exception ex)
                {
                    if (ErrorHandler.IsCriticalException(ex))
                    {
                        throw;
                    }

                    Trace.TraceError(ex.ToString());
                }

                try
                {
                    if (designTime)
                    {
                        Marshal.ThrowExceptionForHR(accessor.EndDesignTimeBuild());
                    }
                }
                catch (Exception ex)
                {
                    if (ErrorHandler.IsCriticalException(ex))
                    {
                        throw;
                    }

                    Trace.TraceError(ex.ToString());
                }


                try
                {
                    if (requiresUIThread)
                    {
                        Marshal.ThrowExceptionForHR(accessor.ReleaseUIThreadForBuild());
                    }
                }
                catch (Exception ex)
                {
                    if (ErrorHandler.IsCriticalException(ex))
                    {
                        throw;
                    }

                    Trace.TraceError(ex.ToString());
                }
            }
            else
            {
                MSBuildExecution.BuildManager.DefaultBuildManager.EndBuild();
            }

            BuildInProgress = false;
        }
ProjectNode