/// <summary>
        /// Called before any build actions have begun. This is the last chance to cancel the build before any building begins.
        /// </summary>
        /// <param name="cancelUpdate">Flag indicating cancel update.</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
        public int UpdateSolution_Begin(ref int cancelUpdate)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            // Query build manager operation flag
            uint buildManagerOperation;

            ErrorHandler.ThrowOnFailure(
                _solutionBuildManager.QueryBuildManagerBusyEx(out buildManagerOperation));

            if (buildManagerOperation == (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_CLEAN)
            {
                // Clear the project.json restore cache on clean to ensure that the next build restores again
                SolutionRestoreWorker.Value.CleanCache();

                return(VSConstants.S_OK);
            }

            if (!ShouldRestoreOnBuild)
            {
                return(VSConstants.S_OK);
            }

            // start a restore task
            var forceRestore = buildManagerOperation == REBUILD_FLAG;

            _restoreTask = RestoreTask.Start(SolutionRestoreWorker.Value, forceRestore);

            return(VSConstants.S_OK);
        }
Beispiel #2
0
        private void btnStartRest_Click(object sender, EventArgs e)
        {
            if (Utilities.IsSteamRunning())
            {
                MessageBox.Show(Resources.RestoreSteamRunningText, Resources.SteamRunningTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                m_canceled = false;

                m_task.Start();

                Close();
            }
        }