Fix registry inputs not loading correctly
This commit is contained in:
parent
2485fc7cb3
commit
a430c93830
1 changed files with 19 additions and 5 deletions
|
@ -2,11 +2,10 @@
|
|||
<AddOnBefore>
|
||||
<SimpleSelect @bind-Value="Hive" Style="width: auto;" OnSelectedItemsChanged="() => OnChanged()">
|
||||
<SelectOptions>
|
||||
<SimpleSelectOption Value="HKCR:\" Label="HKCR:\"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="HKCU:\" Label="HKCU:\"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="HKLM:\" Label="HKLM:\"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="HKU:\" Label="HKU:\"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="HKCC:\" Label="HKCC:\"></SimpleSelectOption>
|
||||
@foreach (var hive in AvailableHives)
|
||||
{
|
||||
<SimpleSelectOption Value="@hive" Label="@hive"></SimpleSelectOption>
|
||||
}
|
||||
</SelectOptions>
|
||||
</SimpleSelect>
|
||||
</AddOnBefore>
|
||||
|
@ -19,6 +18,21 @@
|
|||
string Hive = "HKCU:\\";
|
||||
string Path = "SOFTWARE";
|
||||
|
||||
string[] AvailableHives = new string[]
|
||||
{
|
||||
"HKCR:\\",
|
||||
"HKCU:\\",
|
||||
"HKLM:\\",
|
||||
"HKU:\\",
|
||||
"HKCC:\\"
|
||||
};
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Hive = AvailableHives.FirstOrDefault(h => Value != null && Value.StartsWith(h));
|
||||
Path = Value.Substring(Hive.Length);
|
||||
}
|
||||
|
||||
private async void OnChanged()
|
||||
{
|
||||
Value = Hive + Path;
|
||||
|
|
Loading…
Add table
Reference in a new issue