mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05:00
First Selector and Logic
This commit is contained in:
28
functions/private/Set-DownloadEngine.ps1
Normal file
28
functions/private/Set-DownloadEngine.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
function Set-DownloadEngine {
|
||||
$CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] }
|
||||
foreach ($CheckBox in $CheckBoxes) {
|
||||
if ($CheckBox.Key.StartsWith("WPFInstall")) {
|
||||
Switch ($sync.DownloadEngine) {
|
||||
"Winget" {
|
||||
if ($($sync.configs.applications.$($CheckBox.Name).winget) -eq "na"){
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
}
|
||||
else{
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
"Chocolatey"{
|
||||
if ($($sync.configs.applications.$($CheckBox.Name).chocolatey) -eq "na"){
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
}
|
||||
else {
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
default{
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user