From cc7fe02491f91fe0c1463856ba6b3328d885540d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 25 Jul 2020 15:26:23 +0200 Subject: [PATCH] Fix cpu/gpu counter --- VSRepoGUI/MainWindow.xaml.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/VSRepoGUI/MainWindow.xaml.cs b/VSRepoGUI/MainWindow.xaml.cs index b97f058..5809e0a 100644 --- a/VSRepoGUI/MainWindow.xaml.cs +++ b/VSRepoGUI/MainWindow.xaml.cs @@ -661,10 +661,10 @@ private async void TabablzControl_SelectionChanged(object sender, SelectionChang tb.Inlines.Add("\n64Bit OS: " + (SystemInfo.Is64Bit ? "Yes" : "No")); if(SystemInfo.HasMultipleGpus) { - foreach(Gpu gpu in SystemInfo.Gpus) + int i = 0; + foreach (Gpu gpu in SystemInfo.Gpus) { - int i = 0; - tb.Inlines.Add("\nGPU"+ (++i) +": " + gpu.Description); + tb.Inlines.Add("\nGPU"+ (i++) +": " + gpu.Description); } } else @@ -673,10 +673,10 @@ private async void TabablzControl_SelectionChanged(object sender, SelectionChang } if (SystemInfo.HasMultipleCpus) { + int i = 0; foreach (Cpu cpu in SystemInfo.Cpus) { - int i = 0; - tb.Inlines.Add("\nCPU" + (++i) + ": " + cpu.Name); + tb.Inlines.Add("\nCPU" + (i++) + ": " + cpu.Name); } tb.Inlines.Add("\nTotal CPU Cores: " + SystemInfo.TotalCpuCores); tb.Inlines.Add("\nTotal Logical Processors: " + SystemInfo.TotalLogicalProcessors);