默认情况下,命令的分组是其他。
可以通过标注CategoryAttribute来自定义分组。
[Category("我的分组")] public class MyPluginCommand : Command { }
效果如下:
如果分组名与既有的分组名一致,会加到已有的组里。
[Category("导航")] public class MyPluginCommand : Command { }
效果如下:
如果有多个插件,在同一分组,可以通过OrderWeightAttribute标注排序权重。
[OrderWeight(1)] [Category("我的分组")] public class MyPluginCommand1 : Command { } [OrderWeight(2)] [Category("我的分组")] public class MyPluginCommand2 : Command { } [OrderWeight(3)] [Category("我的分组")] public class MyPluginCommand3 : Command { }
设计器效果: