private void AddFromParentMenu()
                {
                    if (!SubShellTypeItem.CanAddMore(this))
                    {
                        return;
                    }
                    using (ShellStoreDialog dlg = new ShellStoreDialog
                    {
                        ShellPath = this.ParentShellPath,
                        IgnoredKeyNames = new List <string> {
                            this.ParentKeyName
                        }
                    })
                    {
                        if (dlg.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                        dlg.SelectedKeyNames.ForEach(keyName =>
                        {
                            if (!SubShellTypeItem.CanAddMore(this))
                            {
                                return;
                            }
                            string srcPath = $@"{dlg.ShellPath}\{keyName}";
                            string dstPath = ObjectPath.GetNewPathWithIndex($@"{ShellPath}\{keyName}", ObjectPath.PathType.Registry);

                            RegistryEx.CopyTo(srcPath, dstPath);
                            this.AddItem(new SubShellItem(this, dstPath));
                        });
                    }
                }
 private void AddReference()
 {
     if (!SubShellTypeItem.CanAddMore(this))
     {
         return;
     }
     using (ShellStoreDialog dlg = new ShellStoreDialog
     {
         ShellPath = ShellItem.CommandStorePath,
         IgnoredKeyNames = ShellItem.SysStoreItemNames.ToList()
     })
     {
         if (dlg.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         dlg.SelectedKeyNames.ForEach(keyName =>
         {
             if (!SubShellTypeItem.CanAddMore(this))
             {
                 return;
             }
             this.AddItem(new SubShellItem(this, keyName));
             this.SubKeyNames.Add(keyName);
             SaveSorting();
         });
     }
 }
                private void AddFromParentMenu()
                {
                    if (!SubShellTypeItem.CanAddMore(this))
                    {
                        return;
                    }
                    using (ShellStoreDialog dlg = new ShellStoreDialog())
                    {
                        dlg.IsReference = false;
                        dlg.ShellPath   = this.ParentShellPath;
                        dlg.Filter      = new Func <string, bool>(itemName => !itemName.Equals(this.ParentKeyName, StringComparison.OrdinalIgnoreCase));
                        if (dlg.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                        foreach (string keyName in dlg.SelectedKeyNames)
                        {
                            if (!SubShellTypeItem.CanAddMore(this))
                            {
                                return;
                            }
                            string srcPath = $@"{dlg.ShellPath}\{keyName}";
                            string dstPath = ObjectPath.GetNewPathWithIndex($@"{ShellPath}\{keyName}", ObjectPath.PathType.Registry);

                            RegistryEx.CopyTo(srcPath, dstPath);
                            this.AddItem(new SubShellItem(this, dstPath));
                        }
                    }
                }
 private void AddReference()
 {
     if (!SubShellTypeItem.CanAddMore(this))
     {
         return;
     }
     using (ShellStoreDialog dlg = new ShellStoreDialog())
     {
         dlg.IsReference = true;
         dlg.ShellPath   = ShellItem.CommandStorePath;
         dlg.Filter      = new Func <string, bool>(itemName => !(AppConfig.HideSysStoreItems &&
                                                                 itemName.StartsWith("Windows.", StringComparison.OrdinalIgnoreCase)));
         if (dlg.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         foreach (string keyName in dlg.SelectedKeyNames)
         {
             if (!SubShellTypeItem.CanAddMore(this))
             {
                 return;
             }
             this.AddItem(new SubShellItem(this, keyName));
             this.SubKeyNames.Add(keyName);
             SaveSorting();
         }
     }
 }
 private void AddNewItem()
 {
     if (!SubShellTypeItem.CanAddMore(this))
     {
         return;
     }
     using (NewShellDialog dlg = new NewShellDialog
     {
         ScenePath = this.ScenePath,
         ShellPath = this.ShellPath
     })
     {
         if (dlg.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         this.AddItem(new SubShellItem(this, dlg.NewItemRegPath));
     }
 }
 private void AddNewItem()
 {
     if (!SubShellTypeItem.CanAddMore(this))
     {
         return;
     }
     using (NewShellDialog dlg = new NewShellDialog())
     {
         dlg.ScenePath = this.ScenePath;
         dlg.ShellPath = ShellItem.CommandStorePath;
         if (dlg.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         SubKeyNames.Add(dlg.NewItemKeyName);
         SaveSorting();
         this.AddItem(new SubShellItem(this, dlg.NewItemKeyName));
     }
 }