Skip to content

Commit

Permalink
Support multi-editing
Browse files Browse the repository at this point in the history
  • Loading branch information
JungleDruid committed Aug 4, 2018
1 parent 3be07fa commit ef5ed6e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Windows Network Editor/formMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ private void listboxNetwork_SelectedIndexChanged(object sender, EventArgs e) {
}

private void buttonEdit_Click(object sender, EventArgs e) {
var profile = listboxNetwork.Items[listboxNetwork.SelectedIndex] as NetworkProfile;
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) {
using (var rkey = hklm.OpenSubKey(NetworkProfilesAddr + "\\" + profile.Guid, true)) {
rkey.SetValue(ProfileNameValue, textName.Text.Trim());
rkey.SetValue(DescriptionValue, textDescription.Text.Trim());
foreach (var item in listboxNetwork.SelectedItems) {
var profile = item as NetworkProfile;
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) {
using (var rkey = hklm.OpenSubKey(NetworkProfilesAddr + "\\" + profile.Guid, true)) {
rkey.SetValue(ProfileNameValue, textName.Text.Trim());
rkey.SetValue(DescriptionValue, textDescription.Text.Trim());
}
}
}

Expand Down

0 comments on commit ef5ed6e

Please sign in to comment.