private void AddCommonItems() { if (!CanAddMore()) { return; } using (ShellCommonDialog dlg = new ShellCommonDialog { ScenePath = this.ScenePath, ShellPath = this.ShellPath }) { if (dlg.ShowDialog() == DialogResult.OK) { dlg.SelectedShellPaths.ForEach(path => this.AddItem(new SubShellItem(path))); this.SortItemByText(); this.SetItemIndex(newItem, 0); } } }
private void AddCommonItems() { if (!CanAddMore()) { return; } using (ShellCommonDialog dlg = new ShellCommonDialog { ScenePath = this.ScenePath, ShellPath = ShellItem.CommandStorePath }) { if (dlg.ShowDialog() == DialogResult.OK) { dlg.SelectedShellPaths.ForEach(path => { string keyName = RegistryEx.GetKeyName(path); this.AddItem(new SubShellItem(this, keyName)); SubKeyNames.Add(keyName); }); WriteRegistry(); } } }