diff --git a/ShowWhatProcessLocksFile.sln b/ShowWhatProcessLocksFile.sln index dbd1d3c..f905e2d 100644 --- a/ShowWhatProcessLocksFile.sln +++ b/ShowWhatProcessLocksFile.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31129.286 @@ -9,6 +8,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "src\Test\Test.cspro EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "src\Installer\Installer.wixproj", "{8D8AB22B-5677-4A21-B25F-75F2409248EC}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{A8406D94-94FD-4135-875A-1A0FF1E54DC5}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitattributes = .gitattributes + .gitignore = .gitignore + .github\workflows\build.ps1 = .github\workflows\build.ps1 + src\Directory.Build.props = src\Directory.Build.props + .github\workflows\main.yaml = .github\workflows\main.yaml + nuget.config = nuget.config + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 diff --git a/src/App/DownloadHandleExe.ps1 b/src/App/DownloadHandleExe.ps1 deleted file mode 100644 index ef36e8d..0000000 --- a/src/App/DownloadHandleExe.ps1 +++ /dev/null @@ -1,35 +0,0 @@ -Param([Parameter(Mandatory=$true)] [string] $targetFolder) - -Function ExtractFileFromArchive($archiveName, $fileName, $dstDirectory) { - Add-Type -Assembly System.IO.Compression.FileSystem - $zip = [IO.Compression.ZipFile]::OpenRead($archiveName) - if (!$zip) { - Write-Error "Can't open '$archiveName' as a zip archive" - } - - $handleExe = $zip.GetEntry("handle.exe") - if (!$handleExe) { - Write-Error "'$archiveName' zip archive doesn't contain '$fileName' file" - } - - New-Item -Force -ItemType "directory" $dstDirectory > $null - [IO.Compression.ZipFileExtensions]::ExtractToFile($handleExe, "$dstDirectory/$fileName") - $zip.Dispose() -} - -Set-StrictMode -Version Latest -$ErrorActionPreference = "Stop" -$ProgressPreference = "SilentlyContinue" - -$archive = "$targetFolder\handle.zip" -New-Item -Force -ItemType "directory" $targetFolder > $null -Write-Host "Download Handle.zip from the web into `n '$archive'" -Invoke-WebRequest ` - -Uri https://download.sysinternals.com/files/Handle.zip ` - -OutFile $archive - -Write-Host "Extract 'handle.exe' from `n '$archive' into `n '$targetFolder'" -ExtractFileFromArchive $archive "handle.exe" $targetFolder - -Write-Host "Remove '$archive'" -Remove-Item $archive diff --git a/src/App/Gui/MainWindowViewModel.cs b/src/App/Gui/MainWindowViewModel.cs index 8e5e863..7524689 100644 --- a/src/App/Gui/MainWindowViewModel.cs +++ b/src/App/Gui/MainWindowViewModel.cs @@ -26,6 +26,7 @@ public ViewModelBase MainControl { mainControl = value; OnPropertyChanged(); + RelayCommand.Refresh(); } } diff --git a/src/App/Gui/Utils/RelayCommand.cs b/src/App/Gui/Utils/RelayCommand.cs index 3ea2a25..ffff43a 100644 --- a/src/App/Gui/Utils/RelayCommand.cs +++ b/src/App/Gui/Utils/RelayCommand.cs @@ -37,7 +37,7 @@ public void Execute(object parameter) methodToExecute(); } - public void Refresh() + public static void Refresh() { CommandManager.InvalidateRequerySuggested(); } @@ -77,7 +77,7 @@ public void Execute(object parameter) methodToExecute((T)parameter); } - public void Refresh() + public static void Refresh() { CommandManager.InvalidateRequerySuggested(); } diff --git a/src/App/ShowWhatProcessLocksFile.csproj b/src/App/ShowWhatProcessLocksFile.csproj index 65c51bc..ae38627 100644 --- a/src/App/ShowWhatProcessLocksFile.csproj +++ b/src/App/ShowWhatProcessLocksFile.csproj @@ -1,4 +1,4 @@ - + WinExe net461 @@ -14,11 +14,7 @@ x64 - - - - - + @@ -33,4 +29,16 @@ + + + + + + + + + +