public SubShellItem(PrivateMultiItemsList list, string regPath) : base(regPath)
 {
     this.Owner             = list;
     BtnMoveUp.MouseDown   += (sender, e) => Owner.MoveItem(this, true);
     BtnMoveDown.MouseDown += (sender, e) => Owner.MoveItem(this, false);
     SetItemTextValue();
 }
 public SeparatorItem(PrivateMultiItemsList list, string regPath)
 {
     this.Owner             = list;
     this.RegPath           = regPath;
     BtnMoveUp.MouseDown   += (sender, e) => Owner.MoveItem(this, true);
     BtnMoveDown.MouseDown += (sender, e) => Owner.MoveItem(this, false);
 }
        protected override bool RunDialog(IntPtr hwndOwner)
        {
            bool   isPublic = true;
            string value    = Microsoft.Win32.Registry.GetValue(this.ParentPath, "SubCommands", null)?.ToString();

            if (value == null)
            {
                isPublic = false;
            }
            else if (value.IsNullOrWhiteSpace())
            {
                using (var shellKey = RegistryEx.GetRegistryKey($@"{ParentPath}\shell"))
                {
                    if (shellKey != null && shellKey.GetSubKeyNames().Length > 0)
                    {
                        isPublic = false;
                    }
                    else
                    {
                        string[] modes = new[] { ResourceString.Cancel, AppString.Dialog.Private, AppString.Dialog.Public };
                        string   mode  = MessageBoxEx.Show(AppString.Message.SelectSubMenuMode, AppString.General.AppName,
                                                           modes, MessageBoxImage.Question, null, modes[1]);
                        if (mode == modes[2])
                        {
                            isPublic = true;
                        }
                        else if (mode == modes[1])
                        {
                            isPublic = false;
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }

            using (SubItemsForm frm = new SubItemsForm())
            {
                frm.Text    = this.Text;
                frm.Icon    = this.Icon;
                frm.TopMost = AppConfig.TopMost;

                if (isPublic)
                {
                    frm.Text += $"({AppString.Dialog.Public})";
                    PulicMultiItemsList list = new PulicMultiItemsList();
                    frm.AddList(list);
                    list.ParentPath = this.ParentPath;
                    list.LoadItems();
                }
                else
                {
                    frm.Text += $"({AppString.Dialog.Private})";
                    PrivateMultiItemsList list = new PrivateMultiItemsList();
                    frm.AddList(list);
                    list.ParentPath = this.ParentPath;
                    list.LoadItems();
                }

                frm.ShowDialog();
            }
            return(false);
        }