protected override bool RunDialog(IntPtr hwndOwner)
 {
     using (SubItemsForm frm = new SubItemsForm())
         using (EnhanceMenusList list = new EnhanceMenusList())
         {
             frm.Text    = AppString.SideBar.EnhanceMenu;
             frm.Icon    = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
             frm.TopMost = AppConfig.TopMost;
             frm.AddList(list);
             list.ScenePath  = this.ScenePath;
             list.UseUserDic = XmlDicHelper.EnhanceMenuPathDic[this.ScenePath];
             list.LoadItems();
             frm.ShowDialog();
         }
     return(false);
 }
 protected override bool RunDialog(IntPtr hwndOwner)
 {
     using (SubItemsForm frm = new SubItemsForm())
         using (DetailedEditList list = new DetailedEditList())
         {
             var location = GuidInfo.GetIconLocation(this.GroupGuid);
             frm.Icon    = ResourceIcon.GetIcon(location.IconPath, location.IconIndex);
             frm.Text    = AppString.Dialog.DetailedEdit.Replace("%s", GuidInfo.GetText(this.GroupGuid));
             frm.TopMost = AppConfig.TopMost;
             frm.AddList(list);
             list.GroupGuid  = this.GroupGuid;
             list.UseUserDic = XmlDicHelper.DetailedEditGuidDic[this.GroupGuid];
             list.LoadItems();
             frm.ShowDialog();
         }
     return(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);
        }