-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from KrzysztofBuchacz/vs2022
Update for Visual Studio 2022
- Loading branch information
Showing
26 changed files
with
291 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using Microsoft.VisualStudio; | ||
using Microsoft.VisualStudio.Shell; | ||
using Microsoft.VisualStudio.Shell.Interop; | ||
|
||
namespace ParallelBuildsMonitor.Events | ||
{ | ||
internal class BuildEvents : IVsUpdateSolutionEvents2 | ||
{ | ||
private uint dwLastAction; | ||
|
||
public int UpdateSolution_StartUpdate(ref int pfCancelUpdate) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int UpdateSolution_Cancel() | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int UpdateSolution_Begin(ref int pfCancelUpdate) | ||
{ | ||
dwLastAction = 0; | ||
PBMCommand.BuildEvents_OnBuildBegin(); | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int UpdateSolution_Done(int fSucceeded, int fModified, int fCancelCommand) | ||
{ | ||
// Find critical path only for Build action not for Clean or any other action | ||
bool findAndSetCriticalPath = (dwLastAction & (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD) != 0; | ||
PBMCommand.BuildEvents_OnBuildDone(findAndSetCriticalPath); | ||
return VSConstants.S_OK; | ||
} | ||
|
||
private string ProjectUniqueName(IVsHierarchy pHierProj) | ||
{ | ||
ThreadHelper.ThrowIfNotOnUIThread(); | ||
pHierProj.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out object project); | ||
return (project as EnvDTE.Project).UniqueName; | ||
} | ||
|
||
public int UpdateProjectCfg_Begin(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, ref int pfCancel) | ||
{ | ||
ThreadHelper.ThrowIfNotOnUIThread(); | ||
PBMCommand.BuildEvents_OnBuildProjConfigBegin(ProjectUniqueName(pHierProj)); | ||
dwLastAction = dwAction; | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, int fSuccess, int fCancel) | ||
{ | ||
ThreadHelper.ThrowIfNotOnUIThread(); | ||
PBMCommand.BuildEvents_OnBuildProjConfigDone(ProjectUniqueName(pHierProj), fSuccess != 0); | ||
return VSConstants.S_OK; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Microsoft.VisualStudio; | ||
using Microsoft.VisualStudio.Shell.Interop; | ||
|
||
|
||
namespace ParallelBuildsMonitor.Events | ||
{ | ||
internal class SolutionEvents : IVsSolutionEvents | ||
{ | ||
public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnQueryCloseProject(IVsHierarchy pHierarchy, int fRemoving, ref int pfCancel) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref int pfCancel) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnQueryCloseSolution(object pUnkReserved, ref int pfCancel) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnBeforeCloseSolution(object pUnkReserved) | ||
{ | ||
return VSConstants.S_OK; | ||
} | ||
|
||
public int OnAfterCloseSolution(object pUnkReserved) | ||
{ | ||
PBMCommand.AfterSolutionClosing(); | ||
return VSConstants.S_OK; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.