本文整理汇总了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);
}
}
示例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);
}
示例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);
}