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>
|
<AddOnBefore>
|
||||||
<SimpleSelect @bind-Value="Hive" Style="width: auto;" OnSelectedItemsChanged="() => OnChanged()">
|
<SimpleSelect @bind-Value="Hive" Style="width: auto;" OnSelectedItemsChanged="() => OnChanged()">
|
||||||
<SelectOptions>
|
<SelectOptions>
|
||||||
<SimpleSelectOption Value="HKCR:\" Label="HKCR:\"></SimpleSelectOption>
|
@foreach (var hive in AvailableHives)
|
||||||
<SimpleSelectOption Value="HKCU:\" Label="HKCU:\"></SimpleSelectOption>
|
{
|
||||||
<SimpleSelectOption Value="HKLM:\" Label="HKLM:\"></SimpleSelectOption>
|
<SimpleSelectOption Value="@hive" Label="@hive"></SimpleSelectOption>
|
||||||
<SimpleSelectOption Value="HKU:\" Label="HKU:\"></SimpleSelectOption>
|
}
|
||||||
<SimpleSelectOption Value="HKCC:\" Label="HKCC:\"></SimpleSelectOption>
|
|
||||||
</SelectOptions>
|
</SelectOptions>
|
||||||
</SimpleSelect>
|
</SimpleSelect>
|
||||||
</AddOnBefore>
|
</AddOnBefore>
|
||||||
|
@ -19,6 +18,21 @@
|
||||||
string Hive = "HKCU:\\";
|
string Hive = "HKCU:\\";
|
||||||
string Path = "SOFTWARE";
|
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()
|
private async void OnChanged()
|
||||||
{
|
{
|
||||||
Value = Hive + Path;
|
Value = Hive + Path;
|
||||||
|
|
Loading…
Add table
Reference in a new issue