├── Plugin
├── Resources
│ ├── ParallelBuildsMonitorWindowLicense.txt
│ ├── Command.png
│ ├── Package.ico
│ └── Preview.png
├── Key.snk
├── License.txt
├── ReleaseNotes.txt
├── PBMControl.xaml
├── Utils.cs
├── ViewModel.cs
├── source.extension.vsixmanifest
├── Events
│ ├── SolutionEvents.cs
│ └── BuildEvents.cs
├── Properties
│ └── AssemblyInfo.cs
├── PBMWindow.cs
├── stylesheet.css
├── SavePng.cs
├── PBMControl.xaml.cs
├── BuildInfo.cs
├── Package.vsct
├── VSPackage.resx
├── ParallelBuildsMonitor.csproj
├── MachineInfo.cs
├── Package.cs
├── PBMCommand.cs
└── DataModel.cs
├── Tests
├── Key.snk
├── BuildFinished.png
├── UnitTestImage.png
├── BeforeBuildStart.png
├── BuildInProgress.png
├── UnitTestImageCopy.png
├── UnitTestImageChanged.png
├── PBM Example.sln CP WithoutBuildTiming.csv
├── PBM Example.sln CP WithBuildTiming.csv
├── MachineInfoTests.cs
├── Properties
│ └── AssemblyInfo.cs
├── TestOutputWithoutBuildTiming.txt
└── ParallelBuildsMonitorTests.csproj
├── Example
├── junk-finddir
│ ├── stdafx.h
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── junk-finddir.cpp
│ ├── junk-finddir.vcxproj.filters
│ └── junk-finddir.vcxproj
├── junk-vector-const
│ ├── stdafx.h
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── junk-vector-const.cpp
│ ├── junk-vector-const.vcxproj.filters
│ └── junk-vector-const.vcxproj
├── constexpr_templates
│ ├── stdafx.h
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── constexpr_templates.cpp
│ ├── PostBuildEvent.bat
│ ├── Problem.cpp
│ ├── constexpr_templates.vcxproj.filters
│ ├── left.cpp
│ ├── Old Trials.cpp
│ └── constexpr_templates.vcxproj
├── variadic-macros-v1
│ ├── stdafx.cpp
│ ├── stdafx.h
│ ├── targetver.h
│ ├── variadic-macros-v1.cpp
│ ├── variadic-macros-v1.vcxproj.filters
│ └── variadic-macros-v1.vcxproj
├── WpfToolTip
│ ├── App.config
│ ├── PreBuildEvent.bat
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── WpfToolTip.csproj
├── DiskPerformance
│ ├── App.config
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── DiskPerformance.csproj
├── README.md
└── Example.sln
├── .editorconfig
├── .gitattributes
├── README.md
├── ParallelBuildsMonitor.sln
└── .gitignore
/Plugin/Resources/ParallelBuildsMonitorWindowLicense.txt:
--------------------------------------------------------------------------------
1 | Author: Krzysztof Buchacz
--------------------------------------------------------------------------------
/Plugin/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Plugin/Key.snk
--------------------------------------------------------------------------------
/Tests/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/Key.snk
--------------------------------------------------------------------------------
/Tests/BuildFinished.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/BuildFinished.png
--------------------------------------------------------------------------------
/Tests/UnitTestImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/UnitTestImage.png
--------------------------------------------------------------------------------
/Tests/BeforeBuildStart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/BeforeBuildStart.png
--------------------------------------------------------------------------------
/Tests/BuildInProgress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/BuildInProgress.png
--------------------------------------------------------------------------------
/Tests/UnitTestImageCopy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/UnitTestImageCopy.png
--------------------------------------------------------------------------------
/Example/junk-finddir/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-finddir/stdafx.h
--------------------------------------------------------------------------------
/Plugin/Resources/Command.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Plugin/Resources/Command.png
--------------------------------------------------------------------------------
/Plugin/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Plugin/Resources/Package.ico
--------------------------------------------------------------------------------
/Plugin/Resources/Preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Plugin/Resources/Preview.png
--------------------------------------------------------------------------------
/Example/junk-finddir/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-finddir/stdafx.cpp
--------------------------------------------------------------------------------
/Example/junk-finddir/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-finddir/targetver.h
--------------------------------------------------------------------------------
/Tests/UnitTestImageChanged.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Tests/UnitTestImageChanged.png
--------------------------------------------------------------------------------
/Example/junk-vector-const/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-vector-const/stdafx.h
--------------------------------------------------------------------------------
/Example/constexpr_templates/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/constexpr_templates/stdafx.h
--------------------------------------------------------------------------------
/Example/junk-finddir/junk-finddir.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-finddir/junk-finddir.cpp
--------------------------------------------------------------------------------
/Example/junk-vector-const/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-vector-const/stdafx.cpp
--------------------------------------------------------------------------------
/Example/junk-vector-const/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-vector-const/targetver.h
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/variadic-macros-v1/stdafx.cpp
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/variadic-macros-v1/stdafx.h
--------------------------------------------------------------------------------
/Example/constexpr_templates/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/constexpr_templates/stdafx.cpp
--------------------------------------------------------------------------------
/Example/constexpr_templates/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/constexpr_templates/targetver.h
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/variadic-macros-v1/targetver.h
--------------------------------------------------------------------------------
/Example/junk-vector-const/junk-vector-const.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/junk-vector-const/junk-vector-const.cpp
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/variadic-macros-v1.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/variadic-macros-v1/variadic-macros-v1.cpp
--------------------------------------------------------------------------------
/Example/constexpr_templates/constexpr_templates.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KrzysztofBuchacz/ParallelBuildsMonitor/HEAD/Example/constexpr_templates/constexpr_templates.cpp
--------------------------------------------------------------------------------
/Example/WpfToolTip/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/PreBuildEvent.bat:
--------------------------------------------------------------------------------
1 | @echo PreBuildEvent.bat Begin
2 | @rem @TIMEOUT /T 2 - doesn't work when called in VS Post Build Event
3 | @rem @sleep 2 - unknown command
4 | PING localhost -n 3 >NUL
5 | @echo PreBuildEvent.bat End
6 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/PostBuildEvent.bat:
--------------------------------------------------------------------------------
1 | @echo PostBuildEvent.bat Begin
2 | @rem @TIMEOUT /T 2 - doesn't work when called in VS Post Build Event
3 | @rem @sleep 2 - unknown command
4 | PING localhost -n 1 >NUL
5 | @echo PostBuildEvent.bat End
6 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | ###############################
2 | # Core EditorConfig Options #
3 | ###############################
4 |
5 | root = true
6 |
7 | # All files
8 | [*]
9 | indent_style = space
10 |
11 | # Code files
12 | [*.{cs,csx,vb,vbx,xaml,txt,vsct}]
13 | indent_size = 4
14 | insert_final_newline = true
15 |
--------------------------------------------------------------------------------
/Example/README.md:
--------------------------------------------------------------------------------
1 | # Example to test Parallel Builds Monitor
2 |
3 | Created in VS 2017
4 |
5 | .
6 |
7 | Just and Rebuild with "Parallel Builds Monitor" installed and shown to see Gantt chart.
8 |
9 | .
10 |
11 | Projects inside doesn't do anything special nor smart and are full of bugs.
12 | Intent of this solution is to have some projects with dependencies.
13 |
14 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace WpfToolTip
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace DiskPerformance
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/Tests/PBM Example.sln CP WithoutBuildTiming.csv:
--------------------------------------------------------------------------------
1 | "CRICTICAL PATH for | Build Started: 0001-01-01 00:00:00 | Processors: 1 | Cores: 2 | CPU Speed: 2.7GHz | Hyper Threading: Enabled | RAM: 8GB | HDD: 1 SSD"
2 | "Summary Report:"
3 | "Critical Path Order", "Project Name", "Build Time in [s] (Sorted Descending)", "Start Time [s]", "End Time [s]"
4 | "2", "WpfToolTip.csproj", "6", "4", "10"
5 | "3", "variadic-macros-v1.vcxproj", "4", "10", "14"
6 | "1", "junk-finddir.vcxproj", "4", "0", "4"
7 |
--------------------------------------------------------------------------------
/Plugin/License.txt:
--------------------------------------------------------------------------------
1 | Parallel Builds Monitor License
2 | Copyright 2016 Krzysztof Buchacz
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/Problem.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include
3 | #include
4 |
5 |
6 | class MyClass
7 | {
8 | std::string name;
9 | float* valPtr;
10 |
11 | public:
12 | MyClass(std::string _name, float* _valPtr = nullptr)
13 | : name(_name)
14 | , valPtr(_valPtr)
15 | {
16 | }
17 | };
18 |
19 | #define MYCLASS(x) MyClass _##x(#x, &x)
20 | #define MYCLASS_NEW(name, x) \
21 | const char new_name[] = "zzzz"; \
22 | MyClass ___##new_name(new_name, &x);
23 |
24 |
25 | //---
26 |
27 | class OtherClass
28 | {
29 | public:
30 | float val;
31 | OtherClass(float _val) : val{ _val } {}
32 | };
33 |
34 |
35 | //------------------------------------
36 |
37 |
38 | void Problem()
39 | {
40 | float f = 1.0f;
41 | MYCLASS(f); //calls MyClass _f("f", &f);
42 |
43 | OtherClass a(2.0f);
44 | //MYCLASS(a.val); // I would like it to call MyClass _val("val", &a.val)
45 | MYCLASS_NEW(val, a.val);
46 | }
47 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace WpfToolTip
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public ToolTip tt = new ToolTip();
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 | tt.Content = "TTTTTTTTTol Tiiiiiiiiiip";
28 | tt.Content = string.Empty;
29 | this.btn1.ToolTip = tt;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Tests/PBM Example.sln CP WithBuildTiming.csv:
--------------------------------------------------------------------------------
1 | "CRICTICAL PATH for | Build Started: 0001-01-01 00:00:00 | Processors: 1 | Cores: 2 | CPU Speed: 2.7GHz | Hyper Threading: Enabled | RAM: 8GB | HDD: 1 SSD"
2 | "Summary Report:", , , , , , "Detailed Report: (Columns Sorted Descending according to sum for column)"
3 | "Critical Path Order", "Project Name", "Build Time in [s] (Sorted Descending)", "Start Time [s]", "End Time [s]", , "CL [ms]", "Link [ms]", "CppClean [ms]", "GetOutOfDateItems [ms]", "WriteLinesToFile [ms]", "MakeDir [ms]", "Touch [ms]", "SetEnv [ms]", "AssignTargetPath [ms]", "Delete [ms]", "ReadLinesFromFile [ms]", "ResolvePackageFileConflicts [ms]", "AssignProjectConfiguration [ms]", "Message [ms]", "AssignCulture [ms]", "FindUnderPath [ms]", "MSBuild [ms]", "RemoveDuplicates [ms]"
4 | "2", "WpfToolTip.csproj", "6", "4", "10",
5 | "3", "variadic-macros-v1.vcxproj", "4", "10", "14", , "1500", "580", "20", "0", "2", "4", "1", "0", "1", "1", "1", "1", "1", "0", "0", "0", "1", "0"
6 | "1", "junk-finddir.vcxproj", "4", "0", "4", , "3098", "700", "25", "8", "4", "1", "4", "4", "2", "2", "2", "2", "1", "2", "1", "1", "0", "1"
7 |
--------------------------------------------------------------------------------
/Tests/MachineInfoTests.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using ParallelBuildsMonitor;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace ParallelBuildsMonitor.Tests
10 | {
11 | [TestClass()]
12 | public class MachineInfoTests
13 | {
14 | [TestMethod()]
15 | public void ToStringTest()
16 | {
17 | MachineInfo machineInfo = MachineInfo.Instance;
18 | Assert.IsTrue(machineInfo.MachineName.Length > 0);
19 | Assert.IsTrue(machineInfo.PhysicalProcessorsNumber > 0);
20 | Assert.IsTrue(machineInfo.PhysicalCoresNumber > 0);
21 | Assert.IsTrue(machineInfo.LogicalCoresNumber > 0);
22 | Assert.IsTrue(machineInfo.CpusSpeedInMHz.Count > 0);
23 | Assert.IsTrue(machineInfo.CpusSpeedInMHz[0] > 1000);
24 | Assert.IsTrue(machineInfo.TotalPhysicalMemoryInGB > 2);
25 | Assert.IsTrue(machineInfo.PhysicalHDDsNumber > 0);
26 | Assert.IsTrue(machineInfo.HddsTypes.Count > 0);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Plugin/ReleaseNotes.txt:
--------------------------------------------------------------------------------
1 | Parallel Builds Monitor Release Notes
2 | ==========================================
3 |
4 | v. 1.10 2021.12.23
5 | - Add support for VS 2022
6 | - Drop support for VS 2015
7 | - Migrate from packages.config to PackageReference
8 | - Migrate from .NET 4.5.2 to 4.7.1
9 | - Migrate from DTE events to Shell events
10 | - Migrate development environment from VS 2017 to VS 2022
11 | - Minor warnings fixed
12 |
13 | v. 1.9 2019.06.05 Bug fixing
14 | - Remove deprecated API
15 | - Update desription
16 |
17 | v. 1.8 2019.02.08 New features
18 | - Critical Path for build
19 | - CPU and HDD Usage graphs
20 | - Save graph as png and csv
21 | - Saving "Build Timing" to csv
22 | - Show Elapsed Times for projects in progress
23 | - Header with system information
24 | - Improved Gantt chart visualization
25 |
26 | v. 1.7 2019.01.15 (Release only for Visual 2019) Adding Visual 2019 support
27 |
28 | v. 1.7 2017.07.05 Displaying seconds in higher precision
29 |
30 | v. 1.6 2017.04.27 Migration to Visual 2017
31 |
32 | v. 1.5 2016.11.28 License added
33 | - minor change: Configuration and Platform removed from project name to save space
34 |
35 | v. 1.4 2016.11.21 First Release
36 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfToolTip.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DiskPerformance.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Plugin/PBMControl.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Example/junk-finddir/junk-finddir.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Example/junk-vector-const/junk-vector-const.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/variadic-macros-v1.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Parallel Builds Monitor
2 |
3 | Parallel Builds Monitor Visual Studio Extension
4 |
5 | For Visul Studio 2017 2019 2022
6 |
7 | This extension can be installed via [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ivson4.ParallelBuildsMonitor-18691)
8 |
9 | [Release Notes](Plugin/ReleaseNotes.txt)
10 |
11 | ## Git contents:
12 | - `Plugin` - contain `Parallel Build Monitor` extension to be installed in Visual Studio.
13 | - `Example` - contain some dummy project with irrelevant code just to test `Parallel Build Monitor` plugin.
14 | - `Tests` - unit tests for `Plugin`.
15 | - `packages` and `TestResults` - dynamically created directories during build or testing.
16 |
17 |
18 | ## How to debug this project
19 |
20 | Uninstall Parallel Build Monitor if installed
21 |
22 | - Open ParallelBuildsMonitor.sln
23 | - Open project properties
24 | - Go to Debug tab
25 | - Click `Start External Program` and browse for `devenv.exe`
26 | - In `Command line arguments` type `/rootsuffix Exp`
27 | - Start Debugging
28 |
29 | Next Visual Studio will be open. ParallelBuildMonitor will be automatically added to it. If control is not visible open it from menu `View->Other Windows->Parallel Builds Monitor`. Be aware that debugged Visual Studio is open in experimental mode and some settings may be different from your current profile.
30 |
31 | Developed with:
32 | ```
33 | Microsoft Visual Studio Community 2022 (64-bit)
34 | Version 17.0.4
35 | Microsoft .NET Framework
36 | Version 4.7.2
37 | ```
38 |
--------------------------------------------------------------------------------
/Plugin/Utils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ParallelBuildsMonitor
8 | {
9 | public abstract class Utils
10 | {
11 | public static long TicksToSeconds(long Ticks)
12 | {
13 | return (long)(Ticks / 10000000);
14 | }
15 |
16 |
17 | public static string SecondsToString(long Ticks)
18 | {
19 | long seconds = TicksToSeconds(Ticks);
20 | string ret;
21 | if (seconds > 9)
22 | {
23 | ret = (seconds % 60).ToString() + "s";
24 | }
25 | else if (seconds > 0)
26 | {
27 | long dsecs = Ticks / 1000000;
28 | ret = (seconds % 60).ToString() + "." + (dsecs % 10).ToString() + "s";
29 | }
30 | else
31 | {
32 | long csecs = Ticks / 100000;
33 | ret = (seconds % 60).ToString() + "." + ((csecs % 100) < 10 ? "0" : "") + (csecs % 100).ToString() + "s";
34 | }
35 | long minutes = seconds / 60;
36 | if (minutes > 0)
37 | {
38 | ret = (minutes % 60).ToString() + "m" + ret;
39 | long hours = minutes / 60;
40 | if (hours > 0)
41 | {
42 | ret = hours.ToString() + "h" + ret;
43 | }
44 | }
45 | return ret;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ParallelBuildsMonitorTests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ParallelBuildsMonitorTests")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("0a39c616-6716-4530-bbae-a15c0cfce0b0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Plugin/ViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 |
4 | namespace ParallelBuildsMonitor
5 | {
6 | ///
7 | /// Provide interaction DataModel with UI.
8 | ///
9 | // [ImplementPropertyChanged] comes from https://www.nuget.org/packages/PropertyChanged.Fody/
10 | // It is implementing NotifyPropertyChanged for all public class properties,
11 | // so they can be easy bind to UI, without "PropertyChanged()" in each property.
12 | // [ImplementPropertyChanged]
13 | public class ViewModel : System.ComponentModel.INotifyPropertyChanged
14 | {
15 | public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
16 |
17 | #region Creator and Constructors
18 | private ViewModel()
19 | {
20 | }
21 |
22 | private static ViewModel instance = null;
23 | // Singleton
24 | public static ViewModel Instance
25 | {
26 | get
27 | {
28 | if (instance == null)
29 | instance = new ViewModel();
30 | return instance;
31 | }
32 | }
33 | #endregion
34 |
35 |
36 | private bool isGraphDrawn = false;
37 | public bool IsGraphDrawn
38 | {
39 | get
40 | {
41 | return isGraphDrawn;
42 | }
43 | set
44 | {
45 | if (isGraphDrawn == value)
46 | return;
47 |
48 | isGraphDrawn = value;
49 | PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(nameof(IsGraphDrawn)));
50 | }
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/constexpr_templates.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ParallelBuildsMonitor.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.32014.148
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParallelBuildsMonitor", "Plugin\ParallelBuildsMonitor.csproj", "{D045634D-A98B-4D34-9B92-2C1F2D45CB8F}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParallelBuildsMonitorTests", "Tests\ParallelBuildsMonitorTests.csproj", "{0A39C616-6716-4530-BBAE-A15C0CFCE0B0}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D045634D-A98B-4D34-9B92-2C1F2D45CB8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {D045634D-A98B-4D34-9B92-2C1F2D45CB8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {D045634D-A98B-4D34-9B92-2C1F2D45CB8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {D045634D-A98B-4D34-9B92-2C1F2D45CB8F}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {0A39C616-6716-4530-BBAE-A15C0CFCE0B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {0A39C616-6716-4530-BBAE-A15C0CFCE0B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {0A39C616-6716-4530-BBAE-A15C0CFCE0B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {0A39C616-6716-4530-BBAE-A15C0CFCE0B0}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BF635DC2-6702-4979-98CA-40FDF6930AED}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Plugin/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Parallel Builds Monitor
6 | Visualizes compilation process, with project dependencies, critical path and timings in Gantt chart and .csv form
7 | License.txt
8 | ReleaseNotes.txt
9 | Resources\Package.ico
10 | Resources\Preview.png
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Plugin/Events/SolutionEvents.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio;
2 | using Microsoft.VisualStudio.Shell.Interop;
3 |
4 |
5 | namespace ParallelBuildsMonitor.Events
6 | {
7 | internal class SolutionEvents : IVsSolutionEvents
8 | {
9 | public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded)
10 | {
11 | return VSConstants.S_OK;
12 | }
13 |
14 | public int OnQueryCloseProject(IVsHierarchy pHierarchy, int fRemoving, ref int pfCancel)
15 | {
16 | return VSConstants.S_OK;
17 | }
18 |
19 | public int OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved)
20 | {
21 | return VSConstants.S_OK;
22 | }
23 |
24 | public int OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy)
25 | {
26 | return VSConstants.S_OK;
27 | }
28 |
29 | public int OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref int pfCancel)
30 | {
31 | return VSConstants.S_OK;
32 | }
33 |
34 | public int OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
35 | {
36 | return VSConstants.S_OK;
37 | }
38 |
39 | public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution)
40 | {
41 | return VSConstants.S_OK;
42 | }
43 |
44 | public int OnQueryCloseSolution(object pUnkReserved, ref int pfCancel)
45 | {
46 | return VSConstants.S_OK;
47 | }
48 |
49 | public int OnBeforeCloseSolution(object pUnkReserved)
50 | {
51 | return VSConstants.S_OK;
52 | }
53 |
54 | public int OnAfterCloseSolution(object pUnkReserved)
55 | {
56 | PBMCommand.AfterSolutionClosing();
57 | return VSConstants.S_OK;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 | using System.Windows.Threading;
17 |
18 | namespace DiskPerformance
19 | {
20 | public partial class MainWindow : Window
21 | {
22 | DispatcherTimer Timer99 = new DispatcherTimer();
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | Timer99.Tick += Timer99_Tick; // don't freeze the ui
27 | Timer99.Interval = new TimeSpan(0, 0, 0, 0, 1024);
28 | Timer99.IsEnabled = true;
29 | }
30 | public PerformanceCounter myCounter = new PerformanceCounter("PhysicalDisk", "% Disk Time", "_Total");
31 | public PerformanceCounter rwCounter = new PerformanceCounter("PhysicalDisk", "Disk Write Bytes/sec", "_Total");
32 | public PerformanceCounter avgCounter = new PerformanceCounter("PhysicalDisk", "Avg. Disk sec/Read", "_Total");
33 |
34 | public void Timer99_Tick(System.Object sender, System.EventArgs e)
35 |
36 | {
37 | //Console.Clear();
38 | Int32 j = Convert.ToInt32(myCounter.NextValue());
39 | float k = Convert.ToSingle(rwCounter.NextValue());
40 | float l = Convert.ToSingle(avgCounter.NextValue());
41 | //Console.WriteLine(j);
42 |
43 | textblock1.Text = "\"PhysicalDisk\", \"% Disk Time\", \"_Total\": " + j.ToString()
44 | + "\n\"PhysicalDisk\", \"Disk Write Bytes / sec\", \"_Total\": " + k.ToString()
45 | + "\n\"PhysicalDisk\", \"Avg. Disk sec/Read\", \"_Total\": " + l.ToString();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Plugin/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ParallelBuildsMonitor")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ParallelBuildsMonitor")]
13 | [assembly: AssemblyCopyright("")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // This will expose all members, properties, methods and classes marked as "internal" to ParallelBuildsMonitorTests.
18 | // However it doesn't give access when marked as "private"
19 | [assembly: InternalsVisibleTo("ParallelBuildsMonitorTests, PublicKey="
20 | + "0024000004800000940000000602000000240000525341310004000001000100019d46a38ee6f8"
21 | + "7ddc86f35e34b29e9e662a2f6b904b3b80c9f498590aa6f5a3c1fffc80cb94b773fbe50c617183"
22 | + "f13ac9ea952e4a4a763aee41fb4bc5b16f4ac3862eabfc87f4dd026637fb8266b1074620f69b3b"
23 | + "1f1f70d37a74054cb13570f9c6525ba8d6d9a21b57e6a677cdac2370600ae016bb29c60f5667f5"
24 | + "9e035fb6")]
25 |
26 |
27 | // Setting ComVisible to false makes the types in this assembly not visible
28 | // to COM components. If you need to access a type in this assembly from
29 | // COM, set the ComVisible attribute to true on that type.
30 | [assembly: ComVisible(false)]
31 |
32 | // Version information for an assembly consists of the following four values:
33 | //
34 | // Major Version
35 | // Minor Version
36 | // Build Number
37 | // Revision
38 | //
39 | // You can specify all the values or you can default the Build and Revision Numbers
40 | // by using the '*' as shown below:
41 | // [assembly: AssemblyVersion("1.0.*")]
42 | [assembly: AssemblyVersion("1.10.0.0")]
43 | [assembly: AssemblyFileVersion("1.10.0.0")]
44 |
--------------------------------------------------------------------------------
/Plugin/PBMWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using Microsoft.VisualStudio.Shell;
4 |
5 | namespace ParallelBuildsMonitor
6 | {
7 | ///
8 | /// This class implements the tool window exposed by this package and hosts a user control.
9 | ///
10 | ///
11 | /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
12 | /// usually implemented by the package implementer.
13 | /// IMPORTANT NOTE:
14 | /// "Parallel Builds Monitor" frame header might be visible (e.g.: when tabbed tougheder with "Output" frame),
15 | /// but it does NOT contain PBMWindow object unless it contents is not visible on screen. It means that
16 | /// PBMWindow() constructor, PreProcessMessage() and OnCreate() are never called.
17 | ///
18 | /// This class derives from the ToolWindowPane class provided from the MPF in order to use its
19 | /// implementation of the IVsUIElementPane interface.
20 | ///
21 | ///
22 | [Guid("55ff594a-8ecc-4b14-9c9a-45f869673d62")]
23 | public class PBMWindow : ToolWindowPane
24 | {
25 | public const string Title = "Parallel Builds Monitor";
26 |
27 | ///
28 | /// Initializes a new instance of the class.
29 | ///
30 | public PBMWindow() : base(null)
31 | {
32 | }
33 |
34 | protected override void OnCreate()
35 | {
36 | this.Caption = Title;
37 |
38 | // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
39 | // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
40 | // the object returned by the Content property.
41 | this.Content = new PBMControl();
42 | }
43 |
44 | /////
45 | ///// This method is called only when Visual Studio is closed, NOT when "Parallel Builds Monitor" pane/frame is closed!
46 | /////
47 | //protected override void OnClose()
48 | //{
49 | //}
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Plugin/stylesheet.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | border: 0;
5 | color: #1E1E1E;
6 | font-size: 13px;
7 | font-family: "Segoe UI", Helvetica, Arial, sans-serif;
8 | line-height: 1.45;
9 | word-wrap: break-word;
10 | }
11 |
12 | /* General & 'Reset' Stuff */
13 |
14 |
15 | .container {
16 | width: 980px;
17 | margin: 0 auto;
18 | }
19 |
20 | section {
21 | display: block;
22 | margin: 0;
23 | }
24 |
25 | h1, h2, h3, h4, h5, h6 {
26 | margin: 0;
27 | }
28 |
29 | /* Header,
30 | header - container
31 | h1 - project name
32 | h2 - project description
33 | */
34 |
35 | #header {
36 | color: #FFF;
37 | background: #68217a;
38 | position:relative;
39 | }
40 | #hangcloud {
41 | width: 190px;
42 | height: 160px;
43 | background: url("../images/bannerart03.png");
44 | position: absolute;
45 | top: 0;
46 | right: -30px;
47 | }
48 | h1, h2 {
49 | font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif;
50 | line-height: 1;
51 | margin: 0 18px;;
52 | padding: 0;
53 | }
54 | #header h1 {
55 | font-size: 3.4em;
56 | padding-top: 18px;
57 | font-weight: normal;
58 | margin-left: 15px;
59 | }
60 |
61 | #header h2 {
62 | font-size: 1.5em;
63 | margin-top: 10px;
64 | padding-bottom: 18px;
65 | font-weight: normal;
66 | }
67 |
68 |
69 | #main_content {
70 | width: 100%;
71 | display: flex;
72 | flex-direction: row;
73 | }
74 |
75 |
76 | h1, h2, h3, h4, h5, h6 {
77 | font-weight: bolder;
78 | }
79 |
80 | #main_content h1 {
81 | font-size: 1.8em;
82 | margin-top: 34px;
83 | }
84 |
85 | #main_content h1:first-child {
86 | margin-top: 30px;
87 | }
88 |
89 | #main_content h2 {
90 | font-size: 1.8em;
91 | }
92 | p, ul {
93 | margin: 11px 18px;
94 | }
95 |
96 | #main_content a {
97 | color: #06C;
98 | text-decoration: none;
99 | }
100 | ul {
101 | margin-top: 13px;
102 | margin-left: 18px;
103 | padding-left: 0;
104 | }
105 | ul li {
106 | margin-left: 18px;
107 | padding-left: 0;
108 | }
109 | #lpanel {
110 | width: 620px;
111 | float: left;
112 | }
113 | #rpanel ul {
114 | list-style-type: none;
115 | }
116 | #rpanel ul li {
117 | line-height: 1.8em;
118 | }
119 | #rpanel {
120 | background: #e7e7e7;
121 | width: 360px;
122 | }
123 |
--------------------------------------------------------------------------------
/Plugin/Events/BuildEvents.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio;
2 | using Microsoft.VisualStudio.Shell;
3 | using Microsoft.VisualStudio.Shell.Interop;
4 |
5 | namespace ParallelBuildsMonitor.Events
6 | {
7 | internal class BuildEvents : IVsUpdateSolutionEvents2
8 | {
9 | private uint dwLastAction;
10 |
11 | public int UpdateSolution_StartUpdate(ref int pfCancelUpdate)
12 | {
13 | return VSConstants.S_OK;
14 | }
15 |
16 | public int UpdateSolution_Cancel()
17 | {
18 | return VSConstants.S_OK;
19 | }
20 |
21 | public int OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy)
22 | {
23 | return VSConstants.S_OK;
24 | }
25 |
26 | public int UpdateSolution_Begin(ref int pfCancelUpdate)
27 | {
28 | dwLastAction = 0;
29 | PBMCommand.BuildEvents_OnBuildBegin();
30 | return VSConstants.S_OK;
31 | }
32 |
33 | public int UpdateSolution_Done(int fSucceeded, int fModified, int fCancelCommand)
34 | {
35 | // Find critical path only for Build action not for Clean or any other action
36 | bool findAndSetCriticalPath = (dwLastAction & (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD) != 0;
37 | PBMCommand.BuildEvents_OnBuildDone(findAndSetCriticalPath);
38 | return VSConstants.S_OK;
39 | }
40 |
41 | private string ProjectUniqueName(IVsHierarchy pHierProj)
42 | {
43 | ThreadHelper.ThrowIfNotOnUIThread();
44 | pHierProj.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out object project);
45 | return (project as EnvDTE.Project).UniqueName;
46 | }
47 |
48 | public int UpdateProjectCfg_Begin(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, ref int pfCancel)
49 | {
50 | ThreadHelper.ThrowIfNotOnUIThread();
51 | PBMCommand.BuildEvents_OnBuildProjConfigBegin(ProjectUniqueName(pHierProj));
52 | dwLastAction = dwAction;
53 | return VSConstants.S_OK;
54 | }
55 |
56 | public int UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, int fSuccess, int fCancel)
57 | {
58 | ThreadHelper.ThrowIfNotOnUIThread();
59 | PBMCommand.BuildEvents_OnBuildProjConfigDone(ProjectUniqueName(pHierProj), fSuccess != 0);
60 | return VSConstants.S_OK;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("WpfToolTip")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("WpfToolTip")]
15 | [assembly: AssemblyCopyright("Copyright © 2018")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("DiskPerformance")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("DiskPerformance")]
15 | [assembly: AssemblyCopyright("Copyright © 2018")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/Plugin/SavePng.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Windows;
5 | using System.Windows.Media;
6 | using System.Windows.Media.Imaging;
7 |
8 | namespace ParallelBuildsMonitor
9 | {
10 | public abstract class SavePng
11 | {
12 | ///
13 | /// Store visual representation of any control from screen to .png file.
14 | ///
15 | ///
16 | /// This method save even invisible part of control.
17 | ///
18 | /// Any control like Image, Button, Calendar etc.
19 | /// Providing background will override control transparent background. This is optional, and can be null.
20 | /// Filename with path, where .png will be saved.
21 | public static bool SaveToPng(Visual target, Brush background, string fileName) //Original name was CreateBitmapFromVisual()
22 | {
23 | if (target == null || string.IsNullOrEmpty(fileName))
24 | {
25 | Debug.Assert(false, "Wrong SaveToPng() method call. Fix caller!");
26 | return false;
27 | }
28 |
29 | Rect bounds = VisualTreeHelper.GetDescendantBounds(target);
30 | if (bounds.IsEmpty)
31 | {
32 | Debug.Assert(false, "How it happen that save was not dissabled? Disable SaveAsPng button to avoid wrong call.");
33 | return false;
34 | }
35 |
36 | RenderTargetBitmap renderTarget = new RenderTargetBitmap((Int32)bounds.Width, (Int32)bounds.Height, 96, 96, PixelFormats.Pbgra32);
37 | DrawingVisual visual = new DrawingVisual();
38 | using (DrawingContext context = visual.RenderOpen())
39 | {
40 | if (background != null)
41 | context.DrawRectangle(background, null, new Rect(new Point(), bounds.Size)); // GraphControl has transparent background. This draw background
42 |
43 | VisualBrush visualBrush = new VisualBrush(target);
44 | context.DrawRectangle(visualBrush, null, new Rect(new Point(), bounds.Size));
45 | }
46 |
47 | renderTarget.Render(visual);
48 | PngBitmapEncoder bitmapEncoder = new PngBitmapEncoder();
49 | bitmapEncoder.Frames.Add(BitmapFrame.Create(renderTarget));
50 | using (Stream stm = File.Create(fileName))
51 | {
52 | bitmapEncoder.Save(stm);
53 | }
54 |
55 | return true;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfToolTip.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfToolTip.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DiskPerformance.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DiskPerformance.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Plugin/PBMControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Design;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using Microsoft.VisualStudio.Shell;
6 | using Microsoft.VisualStudio.Shell.Interop;
7 |
8 | namespace ParallelBuildsMonitor
9 | {
10 | ///
11 | /// Interaction logic for PBMControl.
12 | ///
13 | public partial class PBMControl : UserControl
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public PBMControl()
19 | {
20 | this.InitializeComponent();
21 | this.DataContext = ViewModel.Instance;
22 | }
23 |
24 | private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
25 | {
26 | if (GraphControl.Instance == null)
27 | return;
28 |
29 | ScrollViewer scrollViewer = sender as ScrollViewer;
30 | if (scrollViewer != null)
31 | {
32 | if (e.ExtentHeightChange == 0)
33 | {
34 | // user action
35 | if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight)
36 | {
37 | GraphControl.Instance.scrollLast = true;
38 | }
39 | else
40 | {
41 | GraphControl.Instance.scrollLast = false;
42 | }
43 | }
44 | if (e.ExtentHeightChange != 0)
45 | {
46 | if (GraphControl.Instance.scrollLast)
47 | {
48 | scrollViewer.ScrollToBottom();
49 | }
50 | }
51 | }
52 | }
53 |
54 | public bool SaveGraph(string pathToPngFile)
55 | {
56 | if (String.IsNullOrEmpty(pathToPngFile))
57 | {
58 | Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog
59 | {
60 | FileName = DataModel.Instance.GetSaveFileNamePrefix(),
61 | DefaultExt = ".png", // Default file extension
62 | Filter = "Portable Images|*.png" // Filter files by extension
63 | };
64 |
65 | if (dlg.ShowDialog() != true)
66 | return false;
67 |
68 | pathToPngFile = dlg.FileName;
69 | }
70 |
71 | return SavePng.SaveToPng(this.graph, this.Background, pathToPngFile);
72 | }
73 |
74 | private void MyToolWindow_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
75 | {
76 | OleMenuCommandService commandService = PBMCommand.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
77 | CommandID menuID = new CommandID(typeof(PBMCommand.ContextMenuCommandSet).GUID, (int)PBMCommand.ContextMenuCommandSet.idContextMenu);
78 | Point p = this.PointToScreen(e.GetPosition(this));
79 | commandService?.ShowContextMenu(menuID, (int)p.X, (int)p.Y);
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/left.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 |
13 | constexpr char to_lower_helper_char(const char c) {
14 | return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c;
15 | }
16 |
17 | template
18 | constexpr const std::array to_lower_helper(const char(&str)[N], std::integer_sequence) {
19 | return { to_lower_helper_char(str[Nums])... };
20 | }
21 |
22 | template
23 | constexpr const std::array to_lower(const char(&str)[N]) {
24 | //std::cout << __PRETTY_FUNCTION__ << "\n";
25 | return to_lower_helper(str, std::make_integer_sequence());
26 | }
27 |
28 | //-------------------------------------
29 |
30 |
31 | template
32 | constexpr const std::array left_helper(const char(&str)[N], const unsigned int len, std::integer_sequence) {
33 | return { ((Nums < len) ? str[Nums] : '\0')... };
34 | }
35 |
36 |
37 | template
38 | constexpr const std::array left(const char(&str)[N], const unsigned int len) {
39 | //std::cout << __PRETTY_FUNCTION__ << "\n";
40 | const unsigned int lenI = 3;
41 |
42 | return left_helper(str, len, std::make_integer_sequence());
43 | }
44 |
45 |
46 | //-------------------------------------
47 |
48 |
49 | template
50 | constexpr const std::array right_helper(const char(&str)[N], const unsigned int start, std::integer_sequence) {
51 | return { (str[(Nums + start) % N])... };
52 | }
53 |
54 |
55 | template
56 | constexpr const std::array right(const char(&str)[N], const unsigned int start) {
57 | return right_helper(str, start, std::make_integer_sequence());
58 | }
59 |
60 |
61 | //-------------------------------------
62 |
63 | constexpr std::array createA1(const unsigned int len)
64 | {
65 | const unsigned int lenI = 7;
66 | return std::array{ 1, 2, 3 };
67 | }
68 |
69 | void Left()
70 | {
71 | constexpr auto arr = to_lower("TEST");
72 | static_assert(arr[0] == 't', "ERROR");
73 | static_assert(arr[1] == 'e', "ERROR");
74 | static_assert(arr[2] == 's', "ERROR");
75 | static_assert(arr[3] == 't', "ERROR");
76 |
77 | constexpr auto left1 = left("ssWWsssWWW", 4);
78 |
79 | //constexpr const std::size_t len = 6;
80 | //constexpr const unsigned int lenI = 3;
81 | //constexpr const std::array sh4 = short_arr_old4("iiiii", lenI);
82 | std::cout << "\"" << std::string(left1.data()) << "\"" << std::endl;
83 | std::cout << "left1 std::string length: " << std::string(left1.data()).length() << std::endl;
84 | std::cout << "left1 size: " << left1.size() << std::endl;
85 |
86 |
87 | const unsigned int lenI = 3;
88 | auto seq1 = std::make_integer_sequence();
89 |
90 | auto a1 = createA1(7);
91 |
92 |
93 | constexpr auto right1 = right("123456789", 4);
94 | std::cout << "\"" << std::string(right1.data()) << "\"" << std::endl;
95 | std::cout << "right1 std::string length: " << std::string(right1.data()).length() << std::endl;
96 | std::cout << "right1 size: " << right1.size() << std::endl;
97 | }
--------------------------------------------------------------------------------
/Tests/TestOutputWithoutBuildTiming.txt:
--------------------------------------------------------------------------------
1 | 1>------ Rebuild All started: Project: junk-finddir, Configuration: Debug x64 ------
2 | 1>stdafx.cpp
3 | 1>junk-finddir.cpp
4 | 1>junk-finddir.vcxproj -> C:\ParallelBuildsMonitor\Example\x64\Debug\junk-finddir.exe
5 | 2>------ Rebuild All started: Project: WpfToolTip, Configuration: Debug Any CPU ------
6 | 3>------ Rebuild All started: Project: constexpr_templates, Configuration: Debug x64 ------
7 | 4>------ Rebuild All started: Project: DiskPerformance, Configuration: Debug Any CPU ------
8 | 5>------ Rebuild All started: Project: junk-vector-const, Configuration: Debug x64 ------
9 | 5>stdafx.cpp
10 | 3>Compiler Passes:
11 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\CL.exe: Version 19.16.27025.1
12 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c1.dll: Version 19.16.27025.1
13 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c1xx.dll: Version 19.16.27025.1
14 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c2.dll: Version 19.16.27025.1
15 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe: Version 14.16.27025.1
16 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\mspdb140.dll: Version 14.16.27025.1
17 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\1033\clui.dll: Version 19.16.27025.1
18 | 3>
19 | 3>stdafx.cpp
20 | 3>Compiler Passes:
21 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\CL.exe: Version 19.16.27025.1
22 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c1.dll: Version 19.16.27025.1
23 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c1xx.dll: Version 19.16.27025.1
24 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\c2.dll: Version 19.16.27025.1
25 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe: Version 14.16.27025.1
26 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\mspdb140.dll: Version 14.16.27025.1
27 | 3> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\1033\clui.dll: Version 19.16.27025.1
28 | 3>
29 | 3>constexpr_templates.cpp
30 | 5>junk-vector-const.cpp
31 | 4> DiskPerformance -> C:\ParallelBuildsMonitor\Example\DiskPerformance\bin\Debug\DiskPerformance.exe
32 | 5>junk-vector-const.vcxproj -> C:\ParallelBuildsMonitor\Example\x64\Debug\junk-vector-const.exe
33 | 3>left.cpp
34 | 3>Old Trials.cpp
35 | 3>Problem.cpp
36 | 3>Generating Code...
37 | 3>constexpr_templates.vcxproj -> C:\ParallelBuildsMonitor\Example\x64\Debug\constexpr_templates.exe
38 | 3>PostBuildEvent.bat Begin
39 | 2> PreBuildEvent.bat Begin
40 | 2> PreBuildEvent.bat End
41 | 2> WpfToolTip -> C:\ParallelBuildsMonitor\Example\WpfToolTip\bin\Debug\WpfToolTip.exe
42 | 6>------ Rebuild All started: Project: variadic-macros-v1, Configuration: Debug x64 ------
43 | 3>PostBuildEvent.bat End
44 | 6>stdafx.cpp
45 | 6>variadic-macros-v1.cpp
46 | 6>variadic-macros-v1.vcxproj -> C:\ParallelBuildsMonitor\Example\x64\Debug\variadic-macros-v1.exe
47 | ========== Rebuild All: 6 succeeded, 0 failed, 0 skipped ==========
48 |
--------------------------------------------------------------------------------
/Plugin/BuildInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ParallelBuildsMonitor
8 | {
9 | ///
10 | /// Container to hold information about build for one project
11 | ///
12 | public struct BuildInfo
13 | {
14 | public BuildInfo(string projectUniqueName, string projectName, uint projectBuildOrderNumber, long b, long e, bool s)
15 | {
16 | ProjectUniqueName = projectUniqueName;
17 | ProjectName = projectName;
18 | ProjectBuildOrderNumber = projectBuildOrderNumber;
19 | begin = b;
20 | end = e;
21 | success = s;
22 | }
23 |
24 | ///
25 | /// Project stored in Project.UniqueName format.
26 | ///
27 | public string ProjectUniqueName { get; set; } // Probably should be renamed to UniqueName and BuildInfo into ProjectBuildInfo
28 |
29 | ///
30 | /// Project name in human readable format
31 | ///
32 | public string ProjectName { get; set; } // Probably should be renamed to Name and BuildInfo into ProjectBuildInfo
33 |
34 | ///
35 | /// Project build order number, e.g. "1>..." that shows in the Output Build Pane/Window during build.
36 | ///
37 | public uint ProjectBuildOrderNumber { get; set; } // Probably should be renamed to BuildOrderNumber and BuildInfo into ProjectBuildInfo
38 |
39 | ///
40 | /// Start project building time in DateTime.Ticks units
41 | ///
42 | ///
43 | /// This is relative time counted since DataModel.StartTime
44 | ///
45 | public long begin;
46 |
47 | ///
48 | /// End project building time in DateTime.Ticks units
49 | ///
50 | ///
51 | /// This is relative time counted since DataModel.StartTime
52 | ///
53 | public long end;
54 |
55 | ///
56 | /// Was build successful?
57 | ///
58 | public bool success;
59 |
60 | ///
61 | /// Return how long took project build in DateTime.Ticks units
62 | ///
63 | public long ElapsedTime //TODO: Should it be renamed to BuildTime?
64 | {
65 | get
66 | {
67 | return end - begin;
68 | }
69 | }
70 | }
71 |
72 | #region Sorting
73 |
74 | public class ShorterElapsedTimeFirstInTheListComparer : IComparer
75 | {
76 | public int Compare(BuildInfo x, BuildInfo y)
77 | {
78 | long xEl = x.ElapsedTime;
79 | long yEl = y.ElapsedTime;
80 |
81 | if (xEl > yEl)
82 | return 1;
83 |
84 | if (xEl < yEl)
85 | return -1;
86 |
87 | return 0;
88 | }
89 | }
90 |
91 | // Let's keep this code in comment since:
92 | // - it was tested and it is OK
93 | // - but it never return 0, so sorting twice when there is the same value give different results!
94 | //public class FirstStartedFirstInTheListComparer : IComparer
95 | //{
96 | // public int Compare(BuildInfo x, BuildInfo y)
97 | // {
98 | // //1[s] = 10000000[ticks] (1e7)
99 | // if (Math.Abs(x.begin - y.begin) < 10000) // the same statring time
100 | // return (x.end < y.end) ? -1 : 1; // shorter first on list
101 | // return (x.begin < y.begin) ? -1 : 1;
102 | // }
103 | //}
104 |
105 | #endregion Sorting
106 | }
107 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # Build results
11 | [Dd]ebug/
12 | [Dd]ebugPublic/
13 | [Rr]elease/
14 | [Rr]eleases/
15 | x64/
16 | x86/
17 | build/
18 | bld/
19 | [Bb]in/
20 | [Oo]bj/
21 | .vs/
22 |
23 | # Roslyn cache directories
24 | *.ide/
25 |
26 | # MSTest test Results
27 | [Tt]est[Rr]esult*/
28 | [Bb]uild[Ll]og.*
29 |
30 | #NUNIT
31 | *.VisualState.xml
32 | TestResult.xml
33 |
34 | # Build Results of an ATL Project
35 | [Dd]ebugPS/
36 | [Rr]eleasePS/
37 | dlldata.c
38 |
39 | *_i.c
40 | *_p.c
41 | *_i.h
42 | *.ilk
43 | *.meta
44 | *.obj
45 | *.pch
46 | *.pdb
47 | *.pgc
48 | *.pgd
49 | *.rsp
50 | *.sbr
51 | *.tlb
52 | *.tli
53 | *.tlh
54 | *.tmp
55 | *.tmp_proj
56 | *.log
57 | *.vspscc
58 | *.vssscc
59 | .builds
60 | *.pidb
61 | *.svclog
62 | *.scc
63 |
64 | # Chutzpah Test files
65 | _Chutzpah*
66 |
67 | # Visual C++ cache files
68 | ipch/
69 | *.aps
70 | *.ncb
71 | *.opensdf
72 | *.sdf
73 | *.cachefile
74 |
75 | # Visual Studio profiler
76 | *.psess
77 | *.vsp
78 | *.vspx
79 |
80 | # TFS 2012 Local Workspace
81 | $tf/
82 |
83 | # Guidance Automation Toolkit
84 | *.gpState
85 |
86 | # ReSharper is a .NET coding add-in
87 | _ReSharper*/
88 | *.[Rr]e[Ss]harper
89 | *.DotSettings.user
90 |
91 | # JustCode is a .NET coding addin-in
92 | .JustCode
93 |
94 | # TeamCity is a build add-in
95 | _TeamCity*
96 |
97 | # DotCover is a Code Coverage Tool
98 | *.dotCover
99 |
100 | # NCrunch
101 | _NCrunch_*
102 | .*crunch*.local.xml
103 |
104 | # MightyMoose
105 | *.mm.*
106 | AutoTest.Net/
107 |
108 | # Web workbench (sass)
109 | .sass-cache/
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.[Pp]ublish.xml
129 | *.azurePubxml
130 | # TODO: Comment the next line if you want to checkin your web deploy settings
131 | # but database connection strings (with potential passwords) will be unencrypted
132 | *.pubxml
133 | *.publishproj
134 |
135 | # Windows Azure Build Output
136 | csx/
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.dbproj.schemaview
151 | *.pfx
152 | *.publishsettings
153 | node_modules/
154 |
155 | # RIA/Silverlight projects
156 | Generated_Code/
157 |
158 | # Backup & report files from converting an old project file
159 | # to a newer Visual Studio version. Backup files are not needed,
160 | # because we have git ;-)
161 | _UpgradeReport_Files/
162 | Backup*/
163 | UpgradeLog*.XML
164 | UpgradeLog*.htm
165 |
166 | # SQL Server files
167 | *.mdf
168 | *.ldf
169 |
170 | # Business Intelligence projects
171 | *.rdl.data
172 | *.bim.layout
173 | *.bim_*.settings
174 |
175 | # Microsoft Fakes
176 | FakesAssemblies/
177 |
178 | # =========================
179 | # Operating System Files
180 | # =========================
181 |
182 | # OSX
183 | # =========================
184 |
185 | .DS_Store
186 | .AppleDouble
187 | .LSOverride
188 |
189 | # Thumbnails
190 | ._*
191 |
192 | # Files that might appear on external disk
193 | .Spotlight-V100
194 | .Trashes
195 |
196 | # Directories potentially created on remote AFP share
197 | .AppleDB
198 | .AppleDesktop
199 | Network Trash Folder
200 | Temporary Items
201 | .apdisk
202 |
203 | # Windows
204 | # =========================
205 |
206 | # Windows image file caches
207 | Thumbs.db
208 | ehthumbs.db
209 |
210 | # Folder config file
211 | Desktop.ini
212 |
213 | # Recycle Bin used on file shares
214 | $RECYCLE.BIN/
215 |
216 | # Windows Installer files
217 | *.cab
218 | *.msi
219 | *.msm
220 | *.msp
221 |
222 | # Windows shortcuts
223 | *.lnk
224 |
--------------------------------------------------------------------------------
/Example/Example.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.168
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "constexpr_templates", "constexpr_templates\constexpr_templates.vcxproj", "{3982C5EC-7B79-41B1-B5C8-700E57723704}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3} = {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiskPerformance", "DiskPerformance\DiskPerformance.csproj", "{34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}"
12 | ProjectSection(ProjectDependencies) = postProject
13 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3} = {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
14 | EndProjectSection
15 | EndProject
16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "junk-finddir", "junk-finddir\junk-finddir.vcxproj", "{2076BD99-2EBE-4026-AE0B-8A3A85183AA3}"
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "junk-vector-const", "junk-vector-const\junk-vector-const.vcxproj", "{A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}"
19 | ProjectSection(ProjectDependencies) = postProject
20 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3} = {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
21 | EndProjectSection
22 | EndProject
23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "variadic-macros-v1", "variadic-macros-v1\variadic-macros-v1.vcxproj", "{95A0AA1F-4910-42AF-9310-0D34DCBCA526}"
24 | ProjectSection(ProjectDependencies) = postProject
25 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3} = {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
26 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C} = {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}
27 | EndProjectSection
28 | EndProject
29 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfToolTip", "WpfToolTip\WpfToolTip.csproj", "{D9CC08BF-961F-4AA7-8F99-32C79D07B55C}"
30 | ProjectSection(ProjectDependencies) = postProject
31 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3} = {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
32 | EndProjectSection
33 | EndProject
34 | Global
35 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
36 | Debug|x64 = Debug|x64
37 | Release|x64 = Release|x64
38 | EndGlobalSection
39 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
40 | {3982C5EC-7B79-41B1-B5C8-700E57723704}.Debug|x64.ActiveCfg = Debug|x64
41 | {3982C5EC-7B79-41B1-B5C8-700E57723704}.Debug|x64.Build.0 = Debug|x64
42 | {3982C5EC-7B79-41B1-B5C8-700E57723704}.Release|x64.ActiveCfg = Release|x64
43 | {3982C5EC-7B79-41B1-B5C8-700E57723704}.Release|x64.Build.0 = Release|x64
44 | {34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}.Debug|x64.ActiveCfg = Debug|Any CPU
45 | {34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}.Debug|x64.Build.0 = Debug|Any CPU
46 | {34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}.Release|x64.ActiveCfg = Release|Any CPU
47 | {34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}.Release|x64.Build.0 = Release|Any CPU
48 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}.Debug|x64.ActiveCfg = Debug|x64
49 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}.Debug|x64.Build.0 = Debug|x64
50 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}.Release|x64.ActiveCfg = Release|x64
51 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}.Release|x64.Build.0 = Release|x64
52 | {A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}.Debug|x64.ActiveCfg = Debug|x64
53 | {A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}.Debug|x64.Build.0 = Debug|x64
54 | {A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}.Release|x64.ActiveCfg = Release|x64
55 | {A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}.Release|x64.Build.0 = Release|x64
56 | {95A0AA1F-4910-42AF-9310-0D34DCBCA526}.Debug|x64.ActiveCfg = Debug|x64
57 | {95A0AA1F-4910-42AF-9310-0D34DCBCA526}.Debug|x64.Build.0 = Debug|x64
58 | {95A0AA1F-4910-42AF-9310-0D34DCBCA526}.Release|x64.ActiveCfg = Release|x64
59 | {95A0AA1F-4910-42AF-9310-0D34DCBCA526}.Release|x64.Build.0 = Release|x64
60 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}.Debug|x64.ActiveCfg = Debug|Any CPU
61 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}.Debug|x64.Build.0 = Debug|Any CPU
62 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}.Release|x64.ActiveCfg = Release|Any CPU
63 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}.Release|x64.Build.0 = Release|Any CPU
64 | EndGlobalSection
65 | GlobalSection(SolutionProperties) = preSolution
66 | HideSolutionNode = FALSE
67 | EndGlobalSection
68 | GlobalSection(ExtensibilityGlobals) = postSolution
69 | SolutionGuid = {EECD8846-77FC-4B3E-9F19-B823B9774E82}
70 | EndGlobalSection
71 | EndGlobal
72 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/DiskPerformance.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {34AAC5B7-BDBB-4671-A6FB-EAB482135B6B}
8 | WinExe
9 | DiskPerformance
10 | DiskPerformance
11 | v4.6.1
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | true
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | 4.0
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | MSBuild:Compile
56 | Designer
57 |
58 |
59 | MSBuild:Compile
60 | Designer
61 |
62 |
63 | App.xaml
64 | Code
65 |
66 |
67 | MainWindow.xaml
68 | Code
69 |
70 |
71 |
72 |
73 | Code
74 |
75 |
76 | True
77 | True
78 | Resources.resx
79 |
80 |
81 | True
82 | Settings.settings
83 | True
84 |
85 |
86 | ResXFileCodeGenerator
87 | Resources.Designer.cs
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/WpfToolTip.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D9CC08BF-961F-4AA7-8F99-32C79D07B55C}
8 | WinExe
9 | WpfToolTip
10 | WpfToolTip
11 | v4.6.1
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | true
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | 4.0
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | MSBuild:Compile
56 | Designer
57 |
58 |
59 | MSBuild:Compile
60 | Designer
61 |
62 |
63 | App.xaml
64 | Code
65 |
66 |
67 | MainWindow.xaml
68 | Code
69 |
70 |
71 |
72 |
73 | Code
74 |
75 |
76 | True
77 | True
78 | Resources.resx
79 |
80 |
81 | True
82 | Settings.settings
83 | True
84 |
85 |
86 | ResXFileCodeGenerator
87 | Resources.Designer.cs
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | "$(ProjectDir)PreBuildEvent.bat"
100 |
101 |
--------------------------------------------------------------------------------
/Example/WpfToolTip/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Example/DiskPerformance/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/Old Trials.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 |
3 |
4 | //// Example program
5 | //#include
6 | //#include
7 | //#include
8 | //#include
9 | //#include
10 | //#include
11 | //#include
12 | //#include
13 | //
14 | //
15 | //constexpr char to_lower_helper_char(const char c) {
16 | // return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c;
17 | //}
18 | //
19 | //template
20 | //constexpr const std::array to_lower_helper(const char(&str)[N], std::integer_sequence) {
21 | // return { to_lower_helper_char(str[Nums])... };
22 | //}
23 | //
24 | //template
25 | //constexpr const std::array to_lower(const char(&str)[N]) {
26 | // //std::cout << __PRETTY_FUNCTION__ << "\n";
27 | // return to_lower_helper(str, std::make_integer_sequence());
28 | //}
29 | //
30 | //
31 | ////------------------------------------------
32 | //
33 | //
34 | //template
35 | //constexpr const std::array left_helper(const char * str, std::index_sequence)
36 | //{
37 | // std::array a2 = { nbrOfChars... };
38 | // return a2;
39 | //}
40 | //
41 | ////template
42 | ////constexpr const std::array left(const char (&str)[N], std::size_t nbrOfChars)
43 | ////{
44 | //// return left_helper(str, std::make_integer_sequence());
45 | ////}
46 | //
47 | //
48 | //namespace detail {
49 | // template
50 | // decltype(auto) build_string(const char * str, std::index_sequence) {
51 | // return std::make_tuple(str[indices]...);
52 | // }
53 | //}
54 | //
55 | //template
56 | //constexpr decltype(auto) make_string(const char(&str)[N]) {
57 | // return detail::build_string(str, std::make_index_sequence());
58 | //}
59 | //
60 | //
61 | ////------------------------------------------
62 | //
63 | //
64 | ////constexpr char to_lower_helper_char(const char c) {
65 | //// return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c;
66 | ////}
67 | //
68 | //template
69 | //constexpr const std::array right_helper(const char(&str)[N], std::integer_sequence) {
70 | // return { to_lower_helper_char(str[Nums])... };
71 | //}
72 | //
73 | //template
74 | //constexpr const std::array right(const char(&str)[N]) {
75 | // return right_helper(str, std::make_integer_sequence());
76 | //}
77 | //
78 | //
79 | ////------------------------------------------
80 | //
81 | ///*
82 | //template
83 | //constexpr const std::array short_arr(const char * str, std::index_sequence)
84 | //{
85 | //std::array a2 = {nbrOfChars...};
86 | //return a2;
87 | //}
88 | //*/
89 | //
90 | //template
91 | //constexpr const std::array short_arr_old(const char(&str)[N])
92 | //{
93 | // return std::array{'T', 'T', str[3], 'R', 'R', 'R'};
94 | //}
95 | //
96 | //template
97 | //constexpr const std::array short_arr_old2(const char(&str)[N], const int& len)
98 | //{
99 | // return std::array{'T', 'T', str[3], 'R', 'R', 'R'};
100 | //}
101 | //
102 | //
103 | //template
104 | //constexpr const std::array short_arr_old3(const char(&str)[N], const int& len)
105 | //{
106 | // return std::array{'T', 'T', str[3], 'R', 'R', 'R'};
107 | //}
108 | //
109 | ///*
110 | //template
111 | //constexpr const std::array short_arr_old4(const char (&str)[N], const int (& len)[L])
112 | //{
113 | //return std::array{'T', 'T', str[3], 'R', 'R', 'R'};
114 | //}
115 | //*/
116 | //
117 | //template
118 | //constexpr const std::array short_arr_old4_helper(const char(&str)[N], std::integer_sequence) {
119 | // return { to_lower_helper_char(str[Nums])... };
120 | //}
121 | //
122 | //template
123 | //constexpr const std::array short_arr_old4(const char(&str)[N], const unsigned int len)
124 | //{
125 | // return short_arr_old4_helper(str, std::make_integer_sequence());
126 | //}
127 | //
128 | //
129 | //int main()
130 | //{
131 | // constexpr auto arr = to_lower("TEST");
132 | // static_assert(arr[0] == 't', "ERROR");
133 | // static_assert(arr[1] == 'e', "ERROR");
134 | // static_assert(arr[2] == 's', "ERROR");
135 | // static_assert(arr[3] == 't', "ERROR");
136 | //
137 | // //constexpr auto arr2 = right("ABCD.EFGHI");
138 | // constexpr const std::array arr2 = right("ABCD.EFGHI");
139 | // //std::cout << typeid(arr2).name() << std::endl;
140 | // std::cout << std::string(arr2.data()) << std::endl;
141 | //
142 | // constexpr char arr3[] = "TYUIO";
143 | // std::cout << arr3 << std::endl;
144 | //
145 | // //auto it = std::find(arr2.begin(), arr2.end(), '.');
146 | // std::array::const_iterator it = std::find(arr2.begin(), arr2.end(), '.');
147 | // //constexpr const std::array it = std::find(arr2.begin(), arr2.end(), '.');
148 | // //auto it = std::find(std::begin(arr3), std::end(arr3), '.');
149 | // if (it == std::end(arr3))
150 | // std::cout << "NOT FOUND" << std::endl;
151 | // else
152 | // std::cout << *it << std::endl;
153 | //
154 | // auto HelloStrObject = make_string("hello");
155 | // HelloStrObject;
156 | //
157 | // constexpr const std::array shold = short_arr_old("oooooooooo");
158 | // std::cout << std::string(shold.data()) << std::endl;
159 | //
160 | // constexpr const std::array sh2 = short_arr_old2<6, 6>("ggggg", 6);
161 | // std::cout << std::string(sh2.data()) << std::endl;
162 | //
163 | // constexpr const std::array sh3 = short_arr_old3("hhhhh", 6);
164 | // std::cout << std::string(sh3.data()) << std::endl;
165 | //
166 | // constexpr const std::size_t len = 6;
167 | // constexpr const unsigned int lenI = 3;
168 | // constexpr const std::array sh4 = short_arr_old4("iiiii", lenI);
169 | // std::cout << "\"" << std::string(sh4.data()) << "\"" << std::endl;
170 | // std::cout << "sh4 size: " << sh4.size() << std::endl;
171 | //}
--------------------------------------------------------------------------------
/Tests/ParallelBuildsMonitorTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {0A39C616-6716-4530-BBAE-A15C0CFCE0B0}
7 | Library
8 | Properties
9 | ParallelBuildsMonitorTests
10 | ParallelBuildsMonitorTests
11 | v4.7.2
12 | 512
13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 10.0
15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
17 | False
18 | UnitTest
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\Release\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 | true
42 |
43 |
44 | Key.snk
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | {d045634d-a98b-4d34-9b92-2c1f2d45cb8f}
75 | ParallelBuildsMonitor
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | 1.3.2
91 |
92 |
93 | 1.3.2
94 |
95 |
96 |
97 |
98 |
99 |
100 | False
101 |
102 |
103 | False
104 |
105 |
106 | False
107 |
108 |
109 | False
110 |
111 |
112 |
113 |
114 |
115 |
116 |
123 |
--------------------------------------------------------------------------------
/Plugin/Package.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
46 |
47 |
48 |
49 |
51 |
52 |
59 |
66 |
72 |
78 |
79 |
80 |
81 |
82 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/Plugin/VSPackage.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | ParallelBuildsMonitorWindow Extension
122 |
123 |
124 | ParallelBuildsMonitorWindow Visual Studio Extension Detailed Info
125 |
126 |
127 |
128 | Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
--------------------------------------------------------------------------------
/Plugin/ParallelBuildsMonitor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
6 |
7 |
8 | true
9 |
10 |
11 |
12 |
13 | 14.0
14 | publish\
15 | true
16 | Disk
17 | false
18 | Foreground
19 | 7
20 | Days
21 | false
22 | false
23 | true
24 | 0
25 | 1.0.0.%2a
26 | false
27 | false
28 | true
29 |
30 |
31 |
32 | true
33 |
34 |
35 | Key.snk
36 |
37 |
38 |
39 | Debug
40 | AnyCPU
41 | 2.0
42 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
43 | {D045634D-A98B-4D34-9B92-2C1F2D45CB8F}
44 | Library
45 | Properties
46 | ParallelBuildsMonitor
47 | ParallelBuildsMonitor
48 | v4.7.2
49 | true
50 | true
51 | true
52 | true
53 | true
54 | false
55 |
56 |
57 | true
58 | full
59 | false
60 | bin\Debug\
61 | DEBUG;TRACE
62 | prompt
63 | 4
64 |
65 |
66 | pdbonly
67 | true
68 | bin\Release\
69 | TRACE
70 | prompt
71 | 4
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | PBMControl.xaml
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Designer
97 |
98 |
99 |
100 |
101 | Menus.ctmenu
102 |
103 |
104 | Always
105 | true
106 |
107 |
108 | Always
109 | true
110 |
111 |
112 | Always
113 | true
114 |
115 |
116 | Always
117 | true
118 |
119 |
120 | Always
121 | true
122 |
123 |
124 |
125 |
126 |
127 | Designer
128 | MSBuild:Compile
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 | true
148 | VSPackage
149 | Designer
150 |
151 |
152 |
153 |
154 | compile; build; native; contentfiles; analyzers; buildtransitive
155 |
156 |
157 | runtime; build; native; contentfiles; analyzers; buildtransitive
158 | all
159 |
160 |
161 |
162 |
163 |
170 |
--------------------------------------------------------------------------------
/Example/junk-finddir/junk-finddir.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {2076BD99-2EBE-4026-AE0B-8A3A85183AA3}
24 | Win32Proj
25 | junkfinddir
26 | 10.0.17763.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v141
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v141
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v141
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v141
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 |
76 |
77 | true
78 |
79 |
80 | false
81 |
82 |
83 | false
84 |
85 |
86 |
87 | Use
88 | Level3
89 | Disabled
90 | true
91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
92 | true
93 |
94 |
95 | Console
96 | true
97 |
98 |
99 |
100 |
101 | Use
102 | Level3
103 | Disabled
104 | true
105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
106 | true
107 |
108 |
109 | Console
110 | true
111 |
112 |
113 |
114 |
115 | Use
116 | Level3
117 | MaxSpeed
118 | true
119 | true
120 | true
121 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
122 | true
123 |
124 |
125 | Console
126 | true
127 | true
128 | true
129 |
130 |
131 |
132 |
133 | Use
134 | Level3
135 | MaxSpeed
136 | true
137 | true
138 | true
139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
140 | true
141 |
142 |
143 | Console
144 | true
145 | true
146 | true
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | Create
157 | Create
158 | Create
159 | Create
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/Example/junk-vector-const/junk-vector-const.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {A2FD53C9-7BFD-4DA2-B486-22D86277B8BB}
24 | Win32Proj
25 | junkvectorconst
26 | 10.0.17763.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v141
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v141
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v141
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v141
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 |
76 |
77 | true
78 |
79 |
80 | false
81 |
82 |
83 | false
84 |
85 |
86 |
87 | Use
88 | Level4
89 | Disabled
90 | true
91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
92 | true
93 |
94 |
95 | Console
96 | true
97 |
98 |
99 |
100 |
101 | Use
102 | Level3
103 | Disabled
104 | true
105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
106 | true
107 |
108 |
109 | Console
110 | true
111 |
112 |
113 |
114 |
115 | Use
116 | Level3
117 | MaxSpeed
118 | true
119 | true
120 | true
121 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
122 | true
123 |
124 |
125 | Console
126 | true
127 | true
128 | true
129 |
130 |
131 |
132 |
133 | Use
134 | Level3
135 | MaxSpeed
136 | true
137 | true
138 | true
139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
140 | true
141 |
142 |
143 | Console
144 | true
145 | true
146 | true
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | Create
157 | Create
158 | Create
159 | Create
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/Example/variadic-macros-v1/variadic-macros-v1.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {95A0AA1F-4910-42AF-9310-0D34DCBCA526}
24 | Win32Proj
25 | variadicmacrosv1
26 | 10.0.17763.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v141
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v141
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v141
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v141
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 |
76 |
77 | true
78 |
79 |
80 | false
81 |
82 |
83 | false
84 |
85 |
86 |
87 | Use
88 | Level4
89 | Disabled
90 | true
91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
92 | true
93 |
94 |
95 | Console
96 | true
97 |
98 |
99 |
100 |
101 | Use
102 | Level3
103 | Disabled
104 | true
105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
106 | true
107 |
108 |
109 | Console
110 | true
111 |
112 |
113 |
114 |
115 | Use
116 | Level3
117 | MaxSpeed
118 | true
119 | true
120 | true
121 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
122 | true
123 |
124 |
125 | Console
126 | true
127 | true
128 | true
129 |
130 |
131 |
132 |
133 | Use
134 | Level3
135 | MaxSpeed
136 | true
137 | true
138 | true
139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
140 | true
141 |
142 |
143 | Console
144 | true
145 | true
146 | true
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | Create
156 | Create
157 | Create
158 | Create
159 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/Plugin/MachineInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Management;
7 |
8 | namespace ParallelBuildsMonitor
9 | {
10 | ///
11 | /// MachineInfo collect information about machine configuration and return as human readable string.
12 | ///
13 | ///
14 | /// Informations are collected only once and then cached.
15 | ///
16 | public class MachineInfo
17 | {
18 | public string MachineName { get; private set; }
19 | public UInt32 PhysicalProcessorsNumber { get; private set; } = 0;
20 | public UInt32 PhysicalCoresNumber { get; private set; } = 0;
21 | public UInt32 LogicalCoresNumber { get; private set; } = 0;
22 | public ReadOnlyCollection CpusSpeedInMHz { get { return cpusSpeedInMHz.AsReadOnly(); } }
23 | public bool HyperThreadingEnabled { get; private set; } = false;
24 | public int TotalPhysicalMemoryInGB { get; private set; } = 0;
25 | public int PhysicalHDDsNumber { get; private set; } = 0;
26 | public ReadOnlyCollection HddsTypes { get { return hddsTypes.AsReadOnly(); } }
27 |
28 | private List cpusSpeedInMHz = new List();
29 | private List hddsTypes = new List();
30 | private string separatorCached;
31 |
32 | static private MachineInfo instance;
33 | static public MachineInfo Instance
34 | {
35 | get
36 | {
37 | if (instance == null)
38 | instance = new MachineInfo();
39 | return instance;
40 | }
41 | }
42 | private string info = null;
43 |
44 | private MachineInfo()
45 | {
46 | MachineName = Environment.MachineName;
47 |
48 | try
49 | { // Not sure if try{} catch{} is needed here
50 | foreach (var item in new ManagementObjectSearcher("Select NumberOfProcessors, TotalPhysicalMemory from Win32_ComputerSystem").Get())
51 | {
52 | PhysicalProcessorsNumber = (UInt32)item["NumberOfProcessors"];
53 | TotalPhysicalMemoryInGB = (Int32)Math.Round(Convert.ToDouble(item.Properties["TotalPhysicalMemory"].Value) / 1048576 / 1024, 0);
54 | }
55 | }
56 | catch
57 | {
58 | Debug.Assert(false, "Getting Physical Processors Number or Total Physical Memory failed! Exception thrown while trying to possess those values.");
59 | }
60 |
61 | try
62 | { // Not sure if try{} catch{} is needed here
63 | foreach (var item in new ManagementObjectSearcher("Select NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed from Win32_Processor").Get())
64 | {
65 | PhysicalCoresNumber += (UInt32)item["NumberOfCores"];
66 | LogicalCoresNumber += (UInt32)item["NumberOfLogicalProcessors"]; //Environment.ProcessorCount is the same as NumberOfLogicalProcessors
67 | cpusSpeedInMHz.Add((UInt32)item["MaxClockSpeed"]);
68 | }
69 | }
70 | catch
71 | {
72 | Debug.Assert(false, "Getting Physical Cores Number, Logical Cores Number or CPU Speed failed! Exception thrown while trying to possess those values.");
73 | }
74 |
75 |
76 | if (PhysicalCoresNumber != LogicalCoresNumber)
77 | HyperThreadingEnabled = true;
78 |
79 | try
80 | { // Not sure if try{} catch{} is needed here
81 | foreach (var item in new ManagementObjectSearcher("SELECT DeviceID, TotalHeads FROM Win32_DiskDrive").Get())
82 | {
83 | PhysicalHDDsNumber += 1;
84 | }
85 | }
86 | catch
87 | {
88 | Debug.Assert(false, "Getting Physical HDDs Number failed! Exception thrown while trying to possess those values.");
89 | }
90 |
91 |
92 | if (PhysicalHDDsNumber > 0)
93 | {
94 | for (int ii = 0; ii < PhysicalHDDsNumber; ii++)
95 | {
96 | //DetectSsd.DriveType driveType = DetectSsd.IsSsdDrive(ii); // Temporary removing old way
97 | DetectSsd.DriveType driveType = GetDriveType(ii);
98 | hddsTypes.Add(driveType);
99 | }
100 | }
101 | }
102 |
103 | public static DetectSsd.DriveType GetDriveType(int physicalDriveNumber)
104 | {
105 | try
106 | { // Not sure if try{} catch{} is needed here
107 | using (ManagementObjectSearcher physicalDiskSearcher = new ManagementObjectSearcher(
108 | @"\\localhost\ROOT\Microsoft\Windows\Storage",
109 | $"SELECT MediaType FROM MSFT_PhysicalDisk WHERE DeviceID='{physicalDriveNumber}'"))
110 | {
111 | ManagementBaseObject physicalDisk = physicalDiskSearcher.Get().Cast().Single();
112 | UInt16 mediaType = (UInt16)physicalDisk["MediaType"];
113 | switch (mediaType)
114 | { // According to: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/stormgmt/msft-physicaldisk
115 | case 0: return DetectSsd.DriveType.Unknown;
116 | case 3: return DetectSsd.DriveType.Rotational; // Is it correct?
117 | case 4: return DetectSsd.DriveType.SSD;
118 | case 5: return DetectSsd.DriveType.Unknown; // Is it correct?
119 | }
120 |
121 | return DetectSsd.DriveType.Unknown;
122 | }
123 | }
124 | catch
125 | {
126 | Debug.Assert(false, "Getting Type of HDDs failed! Exception thrown while trying to to determine HDD type through ManagementObject.");
127 | return DetectSsd.DriveType.Unknown;
128 | }
129 | }
130 |
131 |
132 | public override string ToString()
133 | {
134 | return ToString(" | ");
135 | }
136 |
137 | public string ToString(string separator)
138 | {
139 | if (separatorCached == separator && info != null)
140 | return info;
141 |
142 | List list = new List();
143 | //if (MachineName.Length > 0) // For now do not add machine name
144 | // list.Add("Machine: " + MachineName);
145 | if (PhysicalProcessorsNumber > 0)
146 | list.Add("Processors: " + PhysicalProcessorsNumber.ToString());
147 | if (PhysicalCoresNumber > 0)
148 | list.Add("Cores: " + PhysicalCoresNumber.ToString());
149 | if (CpusSpeedInMHz.Count > 0)
150 | {
151 | bool AreAllValuesTheSame = !CpusSpeedInMHz.Any(oo => oo != CpusSpeedInMHz[0]);
152 | List values = new List();
153 | foreach (UInt32 value in CpusSpeedInMHz)
154 | {
155 | values.Add(String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:0.0}GHz", ((double)value) / 1000)); //This also do the rounding
156 | if (AreAllValuesTheSame)
157 | break;
158 | }
159 | list.Add("CPU" + ((values.Count > 1) ? "s" : "") + " Speed: " + string.Join(", ", values));
160 | }
161 | if (PhysicalCoresNumber > 0)
162 | list.Add("Hyper Threading: " + (HyperThreadingEnabled ? "Enabled" : "Disabled"));
163 | if (TotalPhysicalMemoryInGB > 0)
164 | list.Add("RAM: " + TotalPhysicalMemoryInGB.ToString() + "GB");
165 | if (PhysicalHDDsNumber > 0)
166 | {
167 | List values = new List();
168 | bool AreAllValuesTheSame = !HddsTypes.Any(oo => oo != HddsTypes[0]);
169 | foreach (DetectSsd.DriveType value in HddsTypes)
170 | {
171 | if (AreAllValuesTheSame)
172 | { // Add only one value if all the same type
173 | if (DetectSsd.DriveType.Unknown != value)
174 | values.Add(value); //If all Unknown then do not add any info.
175 | break;
176 | }
177 | values.Add(value);
178 | }
179 | list.Add("HDD: " + PhysicalHDDsNumber + ((values.Count > 1) ? ":" : "") + ((values.Count > 0) ? " " : "") + string.Join(", ", values));
180 | }
181 |
182 |
183 | separatorCached = separator;
184 | info = string.Join(separator, list);
185 |
186 | return info;
187 | }
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/Plugin/Package.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Design;
3 | using System.Runtime.InteropServices;
4 | using Microsoft.VisualStudio.Shell;
5 | using Microsoft.VisualStudio.Settings;
6 | using Microsoft.VisualStudio.Shell.Interop;
7 | using Microsoft.VisualStudio.Shell.Settings;
8 |
9 | namespace ParallelBuildsMonitor
10 | {
11 | ///
12 | /// This is the class that implements the package exposed by this assembly.
13 | ///
14 | ///
15 | ///
16 | /// The minimum requirement for a class to be considered a valid package for Visual Studio
17 | /// is to implement the IVsPackage interface and register itself with the shell.
18 | /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
19 | /// to do it: it derives from the Package class that provides the implementation of the
20 | /// IVsPackage interface and uses the registration attributes defined in the framework to
21 | /// register itself and its components with the shell. These attributes tell the pkgdef creation
22 | /// utility what data to put into .pkgdef file.
23 | ///
24 | ///
25 | /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file.
26 | ///
27 | ///
28 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
29 | [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About
30 | [ProvideMenuResource("Menus.ctmenu", 1)]
31 | // Not sure if VsDockStyle.Linked is the correctly selected value
32 | [ProvideToolWindow(typeof(PBMWindow), Style = VsDockStyle.Linked, DockedHeight = 200, Window = "DocumentWell", Orientation = ToolWindowOrientation.Bottom)]
33 | [Guid(Package.PackageGuidString)]
34 | public sealed class Package : Microsoft.VisualStudio.Shell.AsyncPackage
35 | {
36 | ///
37 | /// ParallelBuildsMonitorWindowPackage GUID string.
38 | ///
39 | public const string PackageGuidString = "3fe81f94-00df-4a3d-bff1-ae20f305aedb";
40 |
41 |
42 | public Package()
43 | {
44 | // Inside this method you can place any initialization code that does not require
45 | // any Visual Studio service because at this point the package object is created but
46 | // not sited yet inside Visual Studio environment. The place to do all the other
47 | // initialization is the Initialize method.
48 | }
49 |
50 | ///
51 | /// Asynchronic Initialization of the package; this method is called right after the package is sited, so this is the place
52 | /// where you can put all the initialization code that rely on services provided by VisualStudio.
53 | ///
54 | ///
55 | /// This method is called in Background Thread!
56 | ///
57 | /// This method is called:
58 | /// - when user click on "VS -> Menu -> View -> Other Windows -> Parallel Builds Monitor" menu item (menu item is added to VS menu by other means)
59 | /// - if attribute [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, PackageAutoLoadFlags.None)] is applied to AsyncPackage class
60 | ///
61 | ///
62 | /// This method is NOT called:
63 | /// - "Parallel Builds Monitor" pane is available but not active (e.g.: tabbed together with "Output" pange and "Output" pane active).
64 | /// Such state is achieved e.g.: when previous session of Visual Studio is left with with "Output" pane active and "Parallel Builds Monitor"
65 | /// is tabbed with it. That occur even when [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, ...] is applied.
66 | /// This method will be called when solution (SolutionExistsAndFullyLoaded_string) is loaded to VS.
67 | ///
68 | ///
69 | protected override async System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken, IProgress progress)
70 | {
71 | await JoinableTaskFactory.SwitchToMainThreadAsync();
72 | await ShowToolWindow.InitializeAsync(this);
73 | }
74 |
75 | /////
76 | ///// This method is called only when Visual Studio is closed, NOT when "Parallel Builds Monitor" pane/frame is closed!
77 | /////
78 | //protected override int QueryClose(out bool canClose)
79 | //{
80 | // return base.QueryClose(out canClose);
81 | //}
82 | }
83 |
84 |
85 | ///
86 | /// Two goals:
87 | /// 1) Adding "Parallel Builds Monitor" menu item into "VS -> Menu -> View -> Other Windows" menu
88 | /// 2) When "VS -> Menu -> View -> Other Windows -> Parallel Builds Monitor" is clicked,
89 | /// showing "Parallel Builds Monitor" tool window.
90 | ///
91 | internal sealed class ShowToolWindow
92 | {
93 | [Guid("0617d7cf-8a0f-436f-8b05-4be366046686")]
94 | public enum MainMenuCommandSet
95 | {
96 | ShowToolWindow = 0x0100
97 | }
98 |
99 | public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package)
100 | {
101 | { // Adding callback method to "Parallel Builds Monitor" menu item into "VS -> Menu -> View -> Other Windows" menu
102 | IMenuCommandService commandService = (IMenuCommandService)await package.GetServiceAsync(typeof(IMenuCommandService));
103 | Microsoft.Assumes.Present(commandService);
104 | CommandID menuCommandID = new CommandID(typeof(MainMenuCommandSet).GUID, (int)MainMenuCommandSet.ShowToolWindow);
105 | MenuCommand menuItem = new MenuCommand((s, e) => Execute(package), menuCommandID);
106 | commandService.AddCommand(menuItem);
107 | }
108 |
109 | { // Start listening VS Events...
110 | // Should we always collect data even when "Parallel Builds Monitor" pane is closed?
111 | // What if user open PBM pane in the the middle of build? Should we show Gantt chart or draw notice like "Restart build to see results"?
112 | // If we decide not to collect data when PBM pane is closed, then user must manually activate PBM before build in order to have Gantt.
113 | // This is because "Output" pane is left as active after each build, so "Output" pane will be active pane after VS restart.
114 | PBMCommand.Initialize(package);
115 | }
116 |
117 | { // Show and Activate "Parallel Builds Monitor" pane
118 | // Do we really want to activate "Parallel Builds Monitor" pane after each solution load?
119 | // Or maybe we want to do that only once after installation?
120 | // Will it work when PBM plugin is installed whn solution is already opened?
121 |
122 | const string collectionName = "PBMSettings";
123 | const string propertyName = "FirstRun";
124 | SettingsManager settingsManager = new ShellSettingsManager(PBMCommand.ServiceProvider);
125 | WritableSettingsStore writableUserSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
126 | if (!writableUserSettingsStore.CollectionExists(collectionName))
127 | writableUserSettingsStore.CreateCollection(collectionName);
128 |
129 | bool firstRun = writableUserSettingsStore.GetBoolean(collectionName, propertyName, true);
130 | if (firstRun)
131 | {
132 | writableUserSettingsStore.SetBoolean(collectionName, propertyName, false);
133 | Execute(package);
134 | }
135 | }
136 | }
137 |
138 | ///
139 | /// Shows "Parallel Builds Monitor" tool window when "VS -> Menu -> View -> Other Windows -> Parallel Builds Monitor" is clicked.
140 | ///
141 | private static void Execute(AsyncPackage package)
142 | {
143 | ThreadHelper.ThrowIfNotOnUIThread();
144 |
145 | // Get the instance number 0 of this tool window. This window is single instance so this instance
146 | // is actually the only one.
147 | // The last flag is set to true so that if the tool window does not exists it will be created.
148 | ToolWindowPane window = package.FindToolWindow(typeof(PBMWindow), 0, true);
149 | if ((null == window) || (null == window.Frame))
150 | {
151 | throw new NotSupportedException("Cannot create tool window");
152 | }
153 |
154 | IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
155 | Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
156 | }
157 | }
158 |
159 | //// see InitializeToolWindowAsync() method for details about this
160 | //public class PBMWindowState
161 | //{
162 | // public EnvDTE80.DTE2 DTE { get; set; }
163 | //}
164 | }
165 |
--------------------------------------------------------------------------------
/Example/constexpr_templates/constexpr_templates.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {3982C5EC-7B79-41B1-B5C8-700E57723704}
24 | Win32Proj
25 | constexprtemplates
26 | 10.0.17763.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v141
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v141
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v141
46 | Unicode
47 | true
48 |
49 |
50 | Application
51 | false
52 | v141
53 | true
54 | Unicode
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | true
76 |
77 |
78 | true
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 |
88 | Use
89 | Level3
90 | Disabled
91 | true
92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
93 | true
94 | /Bv %(AdditionalOptions)
95 |
96 |
97 | Console
98 | true
99 |
100 |
101 | "$(ProjectDir)PostBuildEvent.bat"
102 |
103 |
104 |
105 |
106 | Use
107 | Level3
108 | Disabled
109 | true
110 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
111 | true
112 | /Bv %(AdditionalOptions)
113 |
114 |
115 | Console
116 | true
117 |
118 |
119 | "$(ProjectDir)PostBuildEvent.bat"
120 |
121 |
122 |
123 |
124 | Use
125 | Level3
126 | MaxSpeed
127 | true
128 | true
129 | true
130 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
131 | true
132 | /Bv %(AdditionalOptions)
133 |
134 |
135 | Console
136 | true
137 | true
138 | true
139 |
140 |
141 | "$(ProjectDir)PostBuildEvent.bat"
142 |
143 |
144 |
145 |
146 | Use
147 | Level3
148 | MaxSpeed
149 | true
150 | true
151 | true
152 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
153 | true
154 | /Bv %(AdditionalOptions)
155 |
156 |
157 | Console
158 | true
159 | true
160 | true
161 |
162 |
163 | "$(ProjectDir)PostBuildEvent.bat"
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 | Create
177 | Create
178 | Create
179 | Create
180 |
181 |
182 |
183 |
184 |
185 |
--------------------------------------------------------------------------------
/Plugin/PBMCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Design;
3 | using System.Runtime.InteropServices;
4 | using Microsoft;
5 | using Microsoft.VisualStudio.Shell;
6 | using Microsoft.VisualStudio.Shell.Interop;
7 | using EnvDTE;
8 | using EnvDTE80;
9 | using System.Collections.Generic;
10 | using System.Diagnostics;
11 |
12 | namespace ParallelBuildsMonitor
13 | {
14 | ///
15 | /// Goal of this class is:
16 | /// - subscrible/unsubscribe to Visual Studio Events
17 | /// - provide access to IServiceProvider interface for other classes
18 | /// - create menu
19 | /// - provide commands and query statuses for menu items
20 | ///
21 | internal static class PBMCommand
22 | {
23 | #region Members
24 |
25 | private static Microsoft.VisualStudio.Shell.Package Package { get; set; }
26 | public static IServiceProvider ServiceProvider { get { return Package; } }
27 | private static DTE2 Dte { get; set; }
28 | private static Events.SolutionEvents SolutionEvents { get; set; }
29 | private static Events.BuildEvents BuildEvents { get; set; }
30 | private static DataModel DataModel { get { return DataModel.Instance; } } // Convinient accessor to data.
31 |
32 | #endregion Members
33 |
34 | #region Initialize
35 |
36 | ///
37 | ///
38 | ///
39 | /// Owner package, not null.
40 | public static void Initialize(Microsoft.VisualStudio.Shell.Package package)
41 | {
42 | ThreadHelper.ThrowIfNotOnUIThread();
43 |
44 | if (package == null)
45 | return;
46 |
47 | if (Package != null)
48 | return; // Protection against double initialization (double subscription to events, double menus etc)
49 |
50 | Package = package;
51 | Dte = ServiceProvider.GetService(typeof(DTE)) as EnvDTE80.DTE2;
52 | Assumes.Present(Dte);
53 |
54 | var svc = ServiceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
55 | Assumes.Present(svc);
56 |
57 | SolutionEvents = new ParallelBuildsMonitor.Events.SolutionEvents();
58 |
59 | svc.AdviseSolutionEvents(SolutionEvents, out _);
60 |
61 | var svb = ServiceProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager;
62 | Assumes.Present(svb);
63 |
64 | BuildEvents = new ParallelBuildsMonitor.Events.BuildEvents();
65 | svb.AdviseUpdateSolutionEvents(BuildEvents, out _);
66 |
67 | CreateMenu();
68 | }
69 |
70 | #endregion Initialize
71 |
72 | #region Menu
73 |
74 | [Guid("048AF9A5-402D-4441-B221-5EEC9ACD93DB")]
75 | public enum ContextMenuCommandSet
76 | {
77 | idContextMenu = 0x1000,
78 | SaveAsPng = 0x0101,
79 | SaveAsCsv = 0x0102
80 | }
81 |
82 | private static void CreateMenu()
83 | {
84 | OleMenuCommandService commandService = ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
85 | Assumes.Present(commandService);
86 |
87 | // Save As .png
88 | var SaveAsPngCommandID = new CommandID(typeof(ContextMenuCommandSet).GUID, (int)ContextMenuCommandSet.SaveAsPng);
89 | var menuItemSaveAsPng = new OleMenuCommand(SaveAsPng, SaveAsPngCommandID);
90 | menuItemSaveAsPng.BeforeQueryStatus += MenuItemSaveAsPng_BeforeQueryStatus;
91 | commandService.AddCommand(menuItemSaveAsPng);
92 |
93 | // Save As .csv
94 | var SaveAsCsvCommandID = new CommandID(typeof(ContextMenuCommandSet).GUID, (int)ContextMenuCommandSet.SaveAsCsv);
95 | var menuItemSaveAsCsv = new OleMenuCommand(SaveAsCsv, SaveAsCsvCommandID);
96 | menuItemSaveAsCsv.BeforeQueryStatus += MenuItemSaveAsCsv_BeforeQueryStatus;
97 | commandService.AddCommand(menuItemSaveAsCsv);
98 | }
99 |
100 | private static void MenuItemSaveAsPng_BeforeQueryStatus(object sender, EventArgs e)
101 | {
102 | if (sender is OleMenuCommand myCommand)
103 | myCommand.Enabled = ViewModel.Instance.IsGraphDrawn;
104 | }
105 |
106 | private static void SaveAsPng(object sender, EventArgs e)
107 | {
108 | try
109 | {
110 | PBMWindow window = Package.FindToolWindow(typeof(PBMWindow), 0, true) as PBMWindow;
111 | PBMControl control = window?.Content as PBMControl;
112 | control?.SaveGraph(null /*pathToPngFile*/);
113 | }
114 | catch
115 | {
116 | Debug.Assert(false, "Saving Gantt chart as .png failed! Exception thrown while trying save .png file.");
117 | }
118 | }
119 |
120 | private static void MenuItemSaveAsCsv_BeforeQueryStatus(object sender, EventArgs e)
121 | {
122 | if (sender is OleMenuCommand myCommand)
123 | myCommand.Enabled = (DataModel.CriticalPath.Count > 0);
124 | }
125 |
126 | private static void SaveAsCsv(object sender, EventArgs e)
127 | {
128 | try
129 | {
130 | ThreadHelper.ThrowIfNotOnUIThread();
131 | string outputPaneContent = GetAllTextFromPane(GetOutputBuildPane()); // Output Build Pane/Window can be cleared even during build, so this is not perfect solution...
132 | SaveCsv.SaveAsCsv(outputPaneContent);
133 | }
134 | catch
135 | {
136 | Debug.Assert(false, "Saving .csv failure! Exception thrown while trying save .csv file.");
137 | }
138 | }
139 |
140 | #endregion Menu
141 |
142 | #region IdeEvents
143 |
144 | ///
145 | ///
146 | ///
147 | /// The same as Project.UniqueName property
148 | ///
149 | ///
150 | ///
151 | public static void BuildEvents_OnBuildProjConfigBegin(string ProjectUniqueName)
152 | {
153 | DataModel.AddCurrentBuild(ProjectUniqueName);
154 | }
155 | ///
156 | ///
157 | ///
158 | /// The same as Project.UniqueName property
159 | ///
160 | ///
161 | ///
162 | ///
163 | public static void BuildEvents_OnBuildProjConfigDone(string ProjectUniqueName, bool Success)
164 | {
165 | DataModel.FinishCurrentBuild(ProjectUniqueName, Success);
166 | }
167 |
168 | public static void BuildEvents_OnBuildBegin()
169 | {
170 | ThreadHelper.ThrowIfNotOnUIThread();
171 |
172 | DataModel.BuildBegin(System.IO.Path.GetFileName(Dte.Solution.FileName));
173 | GraphControl.Instance?.BuildBegin();
174 | }
175 |
176 | ///
177 | /// Get build dependencies.
178 | ///
179 | /// Dictionary where key is Project.UniqueName
180 | /// and value is list of projects that this projects depend on in Project.UniqueName form
181 | static private Dictionary> GetProjectDependenies()
182 | {
183 | ThreadHelper.ThrowIfNotOnUIThread();
184 |
185 | Dictionary> deps = new Dictionary>();
186 |
187 | foreach (BuildDependency bd in Dte.Solution.SolutionBuild.BuildDependencies)
188 | {
189 | string name = bd.Project.UniqueName;
190 | List RequiredProjects = new List();
191 | if (bd.RequiredProjects is Array dep)
192 | {
193 | foreach (Project proj in dep)
194 | RequiredProjects.Add(proj.UniqueName);
195 | }
196 |
197 | deps.Add(name, RequiredProjects);
198 | }
199 |
200 | return deps;
201 | }
202 |
203 | ///
204 | /// BuildEvents_OnBuildDone is called when solution build is finished.
205 | ///
206 | ///
207 | ///
208 | public static void BuildEvents_OnBuildDone(bool findAndSetCriticalPath)
209 | {
210 | DataModel.BuildDone(GetProjectDependenies(), findAndSetCriticalPath);
211 | GraphControl.Instance?.BuildDone();
212 | }
213 |
214 | ///
215 | /// Event called on Closing Solution without closing VS ("VS -> File -> Close Solution").
216 | ///
217 | ///
218 | /// Clear data and graph from prevously executed build.
219 | ///
220 | public static void AfterSolutionClosing()
221 | {
222 | DataModel.Reset();
223 | GraphControl.Instance?.InvalidateVisual();
224 | }
225 |
226 | #endregion IdeEvents
227 |
228 | #region HelperMethods
229 |
230 | public static EnvDTE.OutputWindowPane GetOutputBuildPane()
231 | {
232 | ThreadHelper.ThrowIfNotOnUIThread();
233 |
234 | EnvDTE.OutputWindowPanes panes = Dte.ToolWindows.OutputWindow.OutputWindowPanes;
235 | foreach (EnvDTE.OutputWindowPane pane in panes)
236 | {
237 | if (pane.Name.Contains("Build"))
238 | return pane;
239 | }
240 |
241 | return null;
242 | }
243 |
244 | public static string GetAllTextFromPane(EnvDTE.OutputWindowPane Pane)
245 | {
246 | ThreadHelper.ThrowIfNotOnUIThread();
247 |
248 | if (Pane == null)
249 | return null;
250 |
251 | TextDocument doc = Pane.TextDocument;
252 | TextSelection sel = doc.Selection;
253 | sel.StartOfDocument(false);
254 | sel.EndOfDocument(true);
255 |
256 | string content = sel.Text;
257 |
258 | return content;
259 | }
260 |
261 | #endregion HelperMethods
262 | }
263 | }
264 |
--------------------------------------------------------------------------------
/Plugin/DataModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Timers;
7 |
8 | namespace ParallelBuildsMonitor
9 | {
10 | ///
11 | /// Container to holds all build statistics data
12 | ///
13 | public class DataModel : IDisposable
14 | {
15 | #region Properties
16 |
17 | public string SolutionName { get; private set; }
18 | ///
19 | /// Holds point in time when entire build started (Solution).
20 | ///
21 | public DateTime StartTime { get; private set; }
22 | public ReadOnlyDictionary> CurrentBuilds { get { return new ReadOnlyDictionary>(currentBuilds); } }
23 | public ReadOnlyCollection FinishedBuilds { get { return finishedBuilds.AsReadOnly(); } }
24 | public ReadOnlyDictionary> ProjectDependenies { get { return new ReadOnlyDictionary>(projectDependenies); } }
25 | public ReadOnlyCollection CriticalPath { get { return criticalPath.AsReadOnly(); } }
26 |
27 | public ReadOnlyCollection> CpuUsage { get { return cpuUsage.AsReadOnly(); } }
28 | public ReadOnlyCollection> HddUsage { get { return hddUsage.AsReadOnly(); } }
29 | public int MaxParallelBuilds { get; private set; } = 0;
30 |
31 | public bool IsBuilding { get { return performanceTimer.Enabled; } }
32 |
33 | #endregion Properties
34 |
35 | #region Members
36 |
37 | private readonly Dictionary> currentBuilds = new Dictionary>(); //string is ProjectUniqueName, uint is project build order number, long is project Start time, relative, counted since DataModel.StartTime in DateTime.Ticks units.
38 | private readonly List finishedBuilds = new List();
39 | private Dictionary> projectDependenies = new Dictionary>(); //string is ProjectUniqueName, List is list of projects that Key project depends on
40 | private readonly List criticalPath = new List();
41 |
42 | private readonly List> cpuUsage = new List>();
43 | private readonly List> hddUsage = new List>();
44 |
45 | private readonly PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
46 | private readonly PerformanceCounter hddCounter = new PerformanceCounter("PhysicalDisk", "% Disk Time", "_Total");
47 | private readonly static double performanceTimerInterval = 1000; // 1000 means collect data every 1s.
48 | private readonly System.Timers.Timer performanceTimer = new System.Timers.Timer(performanceTimerInterval);
49 |
50 | static uint projectBuildOrderNumber = 0;
51 |
52 | #endregion Members
53 |
54 | #region Creator, Constructors
55 |
56 | private DataModel()
57 | {
58 | performanceTimer.Elapsed += new ElapsedEventHandler(PerformanceTimerEventTick);
59 | }
60 |
61 | private static DataModel instance = null;
62 | // Singleton
63 | public static DataModel Instance
64 | {
65 | get
66 | {
67 | if (instance == null)
68 | instance = new DataModel();
69 | return instance;
70 | }
71 | }
72 |
73 | public void Reset()
74 | {
75 | //instance = new DataModel(); // It doesn't work! So do it manually...
76 |
77 | StartTime = DateTime.Now;
78 | MaxParallelBuilds = 0;
79 | currentBuilds.Clear();
80 | projectBuildOrderNumber = 0;
81 | finishedBuilds.Clear();
82 | criticalPath.Clear();
83 | cpuUsage.Clear();
84 | hddUsage.Clear();
85 | }
86 |
87 | #endregion Creator, Constructors
88 |
89 | #region Dispose
90 |
91 | private bool disposed = false; // Flag: Has Dispose already been called?
92 |
93 | // Public implementation of Dispose pattern callable by consumers.
94 | public void Dispose()
95 | {
96 | Dispose(true);
97 | GC.SuppressFinalize(this);
98 | }
99 |
100 | // Protected implementation of Dispose pattern.
101 | protected virtual void Dispose(bool disposing)
102 | {
103 | if (disposed)
104 | return;
105 |
106 | if (disposing)
107 | {
108 | // Free any other managed objects here.
109 | cpuCounter.Dispose();
110 | hddCounter.Dispose();
111 | performanceTimer.Dispose();
112 | }
113 |
114 | disposed = true;
115 | }
116 |
117 | #endregion Dispose
118 |
119 | #region Manipulation
120 |
121 | ///
122 | /// Call this method when starting colleting statistics for solution (.sln)
123 | ///
124 | public void BuildBegin(string solutionName)
125 | {
126 | Reset();
127 | SolutionName = solutionName;
128 | StartTime = DateTime.Now;
129 | performanceTimer.Start();
130 | CollectPerformanceData(); // Collect 1st sample. Second will be taken after performanceTimerInterval
131 | }
132 |
133 | public void BuildDone(Dictionary> projectDependenies, bool findAndSetCriticalPath)
134 | {
135 | this.projectDependenies = projectDependenies;
136 | performanceTimer.Stop();
137 |
138 | if (findAndSetCriticalPath)
139 | FindAndSetCriticalPath();
140 | }
141 |
142 | ///
143 | /// Call this method when new project (inside solution) starts building.
144 | ///
145 | ///
146 | public void AddCurrentBuild(string projectKey)
147 | {
148 | // It is assumed that OnBuildProjConfigBegin event come in the same order as numbering (1>...) shows in the Output Build Pane/Window
149 | currentBuilds[projectKey] = new Tuple(++projectBuildOrderNumber, DateTime.Now.Ticks - StartTime.Ticks);
150 | if (currentBuilds.Count > MaxParallelBuilds)
151 | {
152 | MaxParallelBuilds = currentBuilds.Count;
153 | }
154 | }
155 |
156 | ///
157 | /// This method move project from CurrentBuilds to FinishedBuilds array
158 | ///
159 | /// ProjectUniqueName in Project.UniqueName format
160 | /// true on success (when project was successfully moved from CurrentBuilds to FinishedBuilds array
161 | public bool FinishCurrentBuild(string ProjectUniqueName, bool wasBuildSucceessful)
162 | {
163 | if (!CurrentBuilds.ContainsKey(ProjectUniqueName))
164 | return false;
165 |
166 | uint projectBuildOrderNumber = CurrentBuilds[ProjectUniqueName].Item1;
167 | long start = CurrentBuilds[ProjectUniqueName].Item2;
168 | long end = DateTime.Now.Ticks - StartTime.Ticks;
169 | currentBuilds.Remove(ProjectUniqueName);
170 | finishedBuilds.Add(new BuildInfo(ProjectUniqueName, GetHumanReadableProjectName(ProjectUniqueName), projectBuildOrderNumber, start, end, wasBuildSucceessful));
171 |
172 | return true;
173 | }
174 |
175 | #endregion Manipulation
176 |
177 | #region HelperMethods
178 |
179 | ///
180 | /// Return common string with solution name, build start time and machine info.
181 | ///
182 | ///
183 | public string GetSolutionNameWithMachineInfo(string Separator, bool WithBuildStartedStr)
184 | {
185 | return SolutionName + Separator + ((WithBuildStartedStr) ? "Build Started: " : "") + StartTime.ToString("yyyy-MM-dd HH:mm:ss") + Separator + MachineInfo.Instance.ToString(Separator); // Data format "2018-05-08 01.09.07" to preserve correct sorting
186 | }
187 |
188 | ///
189 | /// Return common part for PBM file names, so they are unambiguous and can be sorted on HDD in easy way.
190 | ///
191 | ///
192 | public string GetSaveFileNamePrefix()
193 | {
194 | string date = StartTime.ToString("yyyy-MM-dd HH.mm.ss"); //Format "2018-05-08 01.09.07" to preserve correct sorting
195 | return "PBM " + SolutionName + " " + date;
196 | }
197 |
198 | ///
199 | /// Number of time (in %) for how long max parallel builds were run during solution buils.
200 | ///
201 | ///
202 | public long PercentageProcessorUse()
203 | {
204 | long percentage = 0;
205 | if (MaxParallelBuilds > 0)
206 | {
207 | long nowTicks = DateTime.Now.Ticks;
208 | long firstTick = long.MaxValue;
209 | long lastTick = 0;
210 | long totTicks = 0;
211 | foreach (BuildInfo info in FinishedBuilds)
212 | {
213 | totTicks += info.end - info.begin;
214 | if (info.end > lastTick)
215 | lastTick = info.end;
216 | if (info.begin < firstTick)
217 | firstTick = info.begin;
218 | }
219 | foreach (Tuple start in CurrentBuilds.Values)
220 | {
221 | lastTick = nowTicks - StartTime.Ticks;
222 | totTicks += nowTicks - (start.Item2 + StartTime.Ticks);
223 | }
224 | totTicks /= MaxParallelBuilds;
225 | if (lastTick > firstTick)
226 | {
227 | percentage = totTicks * 100 / (lastTick - firstTick);
228 | }
229 | }
230 | return percentage;
231 | }
232 |
233 | private BuildInfo? GetFinishedProject(string ProjectUniqueName)
234 | {
235 | foreach (BuildInfo proj in finishedBuilds)
236 | {
237 | if (proj.ProjectUniqueName == ProjectUniqueName)
238 | return proj;
239 | }
240 |
241 | return null;
242 | }
243 |
244 | ///
245 | /// Find critical path and store it in criticalPath list.
246 | ///
247 | ///
248 | /// ProjectDependenies need to be initialized before calling this method.
249 | ///
250 | /// true when successfully critical path found and stored in CriticalPath property.
251 | private bool FindAndSetCriticalPath()
252 | {
253 | criticalPath.Clear();
254 |
255 | if ((finishedBuilds.Count < 1) || (ProjectDependenies.Count < 1))
256 | return false;
257 |
258 | BuildInfo lastProject = finishedBuilds[finishedBuilds.Count-1];
259 | criticalPath.Add(lastProject);
260 | if (finishedBuilds.Count == 1)
261 | return true; // Case when Build/Rebuild only 1 project
262 |
263 | while (true)
264 | {
265 | List precedentProjects = ProjectDependenies[lastProject.ProjectUniqueName];
266 | if (precedentProjects.Count < 1)
267 | {
268 | criticalPath.Reverse();
269 | return true; // No precendent project means that this is first project.
270 | }
271 |
272 | double minDiff = double.MaxValue;
273 | BuildInfo minProject = new BuildInfo();
274 | foreach (string precendentProjectUN in precedentProjects)
275 | {
276 | BuildInfo? precendentProject = GetFinishedProject(precendentProjectUN);
277 | if (precendentProject == null)
278 | {
279 | Debug.Assert(false, "Missing project in finishedBuilds collection. Critical path will be drawn incorrectly!");
280 | continue;
281 | }
282 |
283 | long diff = lastProject.begin - precendentProject.Value.end;
284 | if (diff < minDiff)
285 | {
286 | minDiff = diff;
287 | minProject = precendentProject.Value;
288 | }
289 | }
290 |
291 | criticalPath.Add(minProject);
292 | lastProject = minProject;
293 | }
294 | }
295 |
296 | ///
297 | /// Convert Project.UniqueName into short human readable string
298 | ///
299 | /// Project name in Project.UniqueName format
300 | /// Human readable project name
301 | static public string GetHumanReadableProjectName(string ProjectUniqueName)
302 | {
303 | FileInfo fi = new FileInfo(ProjectUniqueName);
304 | string key = fi.Name;
305 | return key;
306 | }
307 |
308 | #endregion HelperMethods
309 |
310 | #region CPU, HDD Performance
311 |
312 | private void PerformanceTimerEventTick(object sender, ElapsedEventArgs e)
313 | {
314 | CollectPerformanceData();
315 | }
316 |
317 | private void CollectPerformanceData()
318 | {
319 | long ticks = DateTime.Now.Ticks;
320 | cpuUsage.Add(new Tuple(ticks, cpuCounter.NextValue()));
321 | hddUsage.Add(new Tuple(ticks, hddCounter.NextValue()));
322 | }
323 |
324 | #endregion CPU, HDD Performance
325 | }
326 | }
327 |
--------------------------------------------------------------------------------