AutoCAD快速开发框架之菜单Menu

菜单模块的结构图如下:

菜单模块通过重载BuildMenuCore函数实现菜单项的加载。

namespace ztcad.ThCad
{
	public class AdminMenu : AdminMenuProvider
	{
		protected override void BuildMenuCore(TreeNode<MenuItem> pluginsNode)
		{
			var menuItem = new MenuItem();
			menuItem.Text = "我的插件";
			var subMenuNode = pluginsNode.Prepend(menuItem);

			var subMenuItem = new MenuItem();
			subMenuItem.Text = "测试一";
			subMenuItem.ActionName = "test1";
			subMenuNode.Append(subMenuItem);

			subMenuItem = new MenuItem();
			subMenuItem.Text = "测试二";
			subMenuItem.ActionName = "test2";
			subMenuNode.Append(subMenuItem);
		}

		public override int Ordinal
		{
			get
			{
				return 100;
			}
		}

	}
}

  

 

posted @ 2021-08-23 10:18  智图CAD  阅读(520)  评论(0编辑  收藏  举报