当前位置: 首页>>代码示例>>C#>>正文


C# Menu.AddDivider方法代码示例

本文整理汇总了C#中Menu.AddDivider方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.AddDivider方法的具体用法?C# Menu.AddDivider怎么用?C# Menu.AddDivider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Menu的用法示例。


在下文中一共展示了Menu.AddDivider方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        // Methods
        /// <summary>
        /// Main menu method, controls submenu popups etc.
        /// </summary>
        /// <param name="context">The context.</param>
        public override void Execute(CommandContext context)
        {
            //TODO: Bit messy, needs a better way or broken up into seperate webedit classes
            if (context.Parameters["showprofiles"] != null)
            {
                ShowProfiles(context.Parameters["showprofiles"]);
                return;
            }

            if (context.Parameters["showkeys"] != null)
            {
                ShowKeys(context.Parameters["showkeys"]);
                return;
            }

            if (context.Parameters["showpersonas"] != null)
            {
                ShowPersonas(context.Parameters["showpersonas"]);
                return;
            }

            if (context.Parameters["showrules"] != null)
            {
                ShowRules(context.Parameters["showrules"], context.Items[0]);
                return;
            }

            //If the request wasn't for a particular submenu then output the base menu.
            Assert.ArgumentNotNull(context, "context");
            if (context.Items.Length == 1)
            {
                SheerResponse.DisableOutput();
                Menu menuControl = new Menu();

                string profilesMenuId = ShortID.NewId().ToString();
                menuControl.Add(profilesMenuId, "Profile Scores", "business/32x32/radar-chart.png", string.Empty,
                                string.Format("webedit:personamenu(showprofiles={0})", profilesMenuId), false,
                                string.Empty, MenuItemType.Submenu);

                string personasMenuId = ShortID.NewId().ToString();
                menuControl.Add(personasMenuId, "Personas", "People/16x16/users2.png", string.Empty,
                                string.Format("webedit:personamenu(showpersonas={0})", personasMenuId), false,
                                string.Empty, MenuItemType.Submenu);

                string activeRulesMenuId = ShortID.NewId().ToString();
                menuControl.Add(activeRulesMenuId, "Active Rules", "Software/32x32/shape_circle.png", string.Empty,
                                string.Format("webedit:personamenu(showrules={0})", activeRulesMenuId), false,
                                string.Empty, MenuItemType.Submenu);

                menuControl.AddDivider();
                menuControl.Add(ShortID.NewId().ToString(), "Reset Profile", "Applications/32x32/recycle.png", string.Empty,
                                "webedit:resetprofile", false,
                                string.Empty, MenuItemType.Normal);

                SheerResponse.EnableOutput();
                SheerResponse.ShowPopup("ChangePersonaButton", "below", menuControl);
            }
        }
开发者ID:adoprog,项目名称:Sitecore-Persona-Switcher,代码行数:63,代码来源:PersonaMenu.cs

示例2: OnViewMenuClick

 /// <summary>
 /// Called when the view menu is clicked.
 /// </summary>
 protected void OnViewMenuClick()
 {
     string str;
     Menu menu = new Menu();
     IWorkflowProvider workflowProvider = Context.ContentDatabase.WorkflowProvider;
     if (workflowProvider != null)
     {
         IWorkflow[] workflows = workflowProvider.GetWorkflows();
         for (int i = 0; i < (int)workflows.Length; i++)
         {
             IWorkflow workflow = workflows[i];
             string paneID = this.GetPaneID(workflow);
             string str1 = Registry.GetString(string.Concat("/Current_User/Panes/", paneID));
             str = (str1 != "hidden" ? "workbox:hide" : "workbox:show");
             string str2 = str;
             menu.Add(Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("ctl"), workflow.Appearance.DisplayName, workflow.Appearance.Icon, string.Empty, string.Concat(str2, "(id=", paneID, ")"), str1 != "hidden", string.Empty, MenuItemType.Check);
         }
         if (menu.Controls.Count > 0)
         {
             menu.AddDivider();
         }
         menu.Add("Refresh", "Applications/16x16/refresh.png", "Refresh");
     }
     Context.ClientPage.ClientResponse.ShowPopup("ViewMenu", "below", menu);
 }
开发者ID:NTTDATA,项目名称:CWC,代码行数:28,代码来源:WorkboxForm.cs

示例3: OnViewMenuClick

 protected void OnViewMenuClick()
 {
     Menu control = new Menu();
     IWorkflowProvider workflowProvider = Context.ContentDatabase.WorkflowProvider;
     if (workflowProvider != null)
     {
         foreach (IWorkflow workflow in workflowProvider.GetWorkflows())
         {
             string paneID = this.GetPaneID(workflow);
             string str2 = Registry.GetString("/Current_User/Panes/" + paneID);
             control.Add(Control.GetUniqueID("ctl"), workflow.Appearance.DisplayName, workflow.Appearance.Icon, string.Empty, ((str2 != "hidden") ? "workbox:hide" : "workbox:show") + "(id=" + paneID + ")", str2 != "hidden", string.Empty, MenuItemType.Check);
         }
         if (control.Controls.Count > 0)
         {
             control.AddDivider();
         }
         control.Add("Refresh", "Applications/16x16/refresh.png", "Refresh");
     }
     Context.ClientPage.ClientResponse.ShowPopup("ViewMenu", "below", control);
 }
开发者ID:udt1106,项目名称:Sitecore-Item-Buckets,代码行数:20,代码来源:ScalableWorkbox.cs


注:本文中的Menu.AddDivider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。