如何扩展ADO.NET实体设计器?
有谁知道如何扩展(即向 Visual Studio 中的实体设计器添加功能)吗?
例如,我想右键单击设计器上实体的属性,并在上下文菜单上有一个新选项,允许我做任何我想做的事情。
Does anyonw know how to extend, i.e., add funcionalities to the Entity Designer in Visual Studio?
For instance, I want to right click a property of an entity on the designer and have a new option on the context-menu that allows me to do any stuff I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VS 2008 SP1 中的实体设计器没有太多可扩展性挂钩。 您可以做的是利用 Visual Studio 扩展性(VSIP,现在称为 VSX):
从这里您可以在DiagramDocView 中执行许多操作。 DiagramDocView.CurrentDiagram 将为您提供图表对象。 您可以调用Diagram.NestedChildShapes来获取图中的所有形状。 要更改图表,您必须创建 DSL 事务并对事务中的形状进行编辑。 这只是实体设计器之上的另一个级别,所有内容都将得到正确处理:
VS 2010 中的实体设计器将具有更多的可扩展性挂钩,允许您通过属性窗口或向导影响模型。 新的“模型优先”功能中的新可扩展性基本上允许您以可组合的方式从 Visual Studio 中的模型生成任何内容。
The Entity Designer in VS 2008 SP1 doesn't have many extensibility hooks. What you could do is leverage the Visual Studio extensibility (VSIP, now known as VSX):
From here you can do lots of things within the DiagramDocView. DiagramDocView.CurrentDiagram will give you the Diagram object. You can call Diagram.NestedChildShapes to get all shapes in the diagram. To make changes to the diagram, you will have to create a DSL transaction and perform your edits to the shapes in the transaction. This is simply another level above the Entity Designer and everything will be handled correctly:
The Entity Designer in VS 2010 will have a lot more extensibility hooks to allow you to influence the model through the property window or through the wizard. New extensibility work in the new 'Model First' feature will basically allow you to generate anything from a model within Visual Studio in a composable way.