private void AddNewShellItem(string scenePath) { string shellPath = GetShellPath(scenePath); using (NewShellDialog dlg = new NewShellDialog()) { dlg.ScenePath = scenePath; dlg.ShellPath = shellPath; if (dlg.ShowDialog() != DialogResult.OK) { return; } for (int i = 0; i < this.Controls.Count; i++) { if (this.Controls[i] is NewItem) { ShellItem item; if (Scene != Scenes.CommandStore) { item = new ShellItem(dlg.NewItemRegPath); } else { item = new StoreShellItem(dlg.NewItemRegPath, true, false); } this.InsertItem(item, i + 1); break; } } } }
private void LoadItems(bool isReference) { using (var shellKey = RegistryEx.GetRegistryKey(ShellPath)) { foreach (string itemName in shellKey.GetSubKeyNames()) { if (Filter != null && !Filter(itemName)) { continue; } string regPath = $@"{ShellPath}\{itemName}"; StoreShellItem item = new StoreShellItem(regPath, isReference); item.SelectedChanged += () => { foreach (StoreShellItem shellItem in list.Controls) { if (!shellItem.IsSelected) { chkSelectAll.Checked = false; return; } } chkSelectAll.Checked = true; }; list.AddItem(item); } } }