本文整理汇总了C#中TreeNode.AddMenuItem方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.AddMenuItem方法的具体用法?C# TreeNode.AddMenuItem怎么用?C# TreeNode.AddMenuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeNode
的用法示例。
在下文中一共展示了TreeNode.AddMenuItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomizeFolderNode
/// <summary>
/// Adds the menu items to the node and sets the icon
/// </summary>
/// <param name="n"></param>
/// <param name="queryStrings"></param>
protected virtual void CustomizeFolderNode(TreeNode n, FormCollection queryStrings)
{
//add the menu items
n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete");
n.AddMenuItem<Reload>();
}
示例2: CustomizeFileNode
protected override void CustomizeFileNode(TreeNode n, FormCollection queryStrings)
{
n.AddEditorMenuItem<CreateItem>(this, "createUrl", "EditRule");
base.CustomizeFileNode(n, queryStrings);
n.AddMenuItem<Reload>();
n.Icon = "tree-css";
using (var uow = Hive.CreateReadonly())
{
var stylesheet = uow.Repositories.Get<File>(n.HiveId);
var rules = StylesheetHelper.ParseRules(stylesheet);
n.HasChildren = rules.Count() > 0;
if (n.HasChildren)
{
n.JsonUrl = Url.GetTreeUrl(GetType(), n.HiveId, queryStrings);
}
}
}
示例3: AddMenuItemsToRootNode
/// <summary>
/// Adds menu items to root node
/// </summary>
/// <param name="n"></param>
/// <param name="queryStrings"></param>
protected virtual void AddMenuItemsToRootNode(TreeNode n, FormCollection queryStrings)
{
if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
{
//add some menu items to the created root node
n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
n.AddEditorMenuItem<Sort>(this, "sortUrl", "Sort");
n.AddMenuItem<Reload>();
}
}
示例4: AddMenuItemsToNode
/// <summary>
/// Adds menu items to each node
/// </summary>
/// <param name="n"></param>
/// <param name="queryStrings"></param>
protected override void AddMenuItemsToNode(TreeNode n, FormCollection queryStrings)
{
if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
{
//add the menu items
n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
//we need to add the recycle bin Id to the metadata so that the UI knows to refresh the bin on delete
n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete", new Dictionary<string, object> {{"recycleBinId", RecycleBinId.ToJsonObject()}});
n.AddEditorMenuItem<Move>(this, "moveUrl", "Move");
n.AddEditorMenuItem<Copy>(this, "copyUrl", "Copy");
n.AddEditorMenuItem<Sort>(this, "sortUrl", "Sort");
n.AddEditorMenuItem<Rollback>(this, "rollbackUrl", "Rollback");
n.AddEditorMenuItem<Publish>(this, "publishUrl", "Publish");
n.AddEditorMenuItem<Permissions>(this, "permissionsUrl", "Permissions");
n.AddEditorMenuItem<PublicAccess>(this, "publicAccessUrl", "PublicAccess");
//n.AddMenuItem<Protect>();
//n.AddMenuItem<Audit>();
//n.AddMenuItem<Notify>();
//nodeData.treeNode.AddMenuItem<SendTranslate>(MenuItems);
n.AddEditorMenuItem<Hostname>(this, "hostnameUrl", "Hostname");
n.AddEditorMenuItem<Language>(this, "languageUrl", "Language");
n.AddMenuItem<Reload>();
}
}
示例5: AddMenuItemsToNodeInRecycleBin
protected override void AddMenuItemsToNodeInRecycleBin(TreeNode n, FormCollection queryStrings)
{
if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
{
//TODO: implement security restrictions here!
//add the menu items
n.AddEditorMenuItem<Move>(this, "moveUrl", "Move");
n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete");
n.AddMenuItem<Reload>();
}
}