diff --git a/revanced.ps1 b/revanced.ps1 index 04816f6..e498c8f 100644 --- a/revanced.ps1 +++ b/revanced.ps1 @@ -65,6 +65,22 @@ class FormItems : System.Collections.ArrayList<#FormItem#> { } return $rvalue } + + FormItems() {} + + FormItems([System.Collections.IEnumerable] $list) { + <# + .Description + Creates FormItems list with all items in list + where values are those items + and displaytext as string representation of them + + TLDR it converts any list to FormItems + #> + foreach ($i in $list) { + [void] $this.Add([FormItem]::new($i, $i.ToString())) + } + } } function renderForm([FormItems]$items, [String]$label, [String]$title, [System.Windows.Forms.SelectionMode]$mode) {