Getting rid of the DSL model explorer
来源:互联网 发布:深沟寺北国知春售房 编辑:程序博客网 时间:2024/05/19 13:21
Every DSL you create with DSL Tools has a model explorer. This model explorer is a tool window in Visual Studio displaying the elements of your model in a hierarchical way. This is often a nice feature but sometimes a hierarchical view of your data is not appropriate. So I came to the question:How to remove the explorer from the generated code?
I could not find any option in the DSL design to remove the model explorer, but if you look at some of the .tt files you will find somewhere a query for this.Dsl.Explorer != null. For example in thepackage.tt file that generates thepackage.cs which is responsible for registering the tool window for the model explorer:
<#
if(this.Dsl.Explorer != null)
{
#>
[VSShell::ProvideToolWindow( typeof(<#= dslName #>ExplorerToolWindow), MultiInstances = false, Style = VSShell::VsDockStyle.Tabbed, Orientation = VSShell::ToolWindowOrientation.Right, Window = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}")]
[VSShell::ProvideToolWindowVisibility( typeof(<#= dslName #>ExplorerToolWindow), Constants.<#= dslName #>EditorFactoryId)]
<#
}
#>
Even if I did not find any option to set theDsl.Explorer property of the model tonull (you did not see the Explorer property anywhere in the DSL diagram) it seems that the developers of the DSL Tools had this use case in mind.
To remove theDsl.Explorer from your DSL model open the.dsl file with a text editor and go to the end. There you will find some XML tags like the following:
<ExplorerExplorerGuid="6c276297-6acd-4e9a-8740-b61ba834004b" Title="HardwareDescription Explorer">
<ExplorerBehaviorMoniker Name="HardwareDescription/HardwareDescriptionExplorer"/>
</Explorer>
Just delete these three lines and generate your code once again. Maybe you should reset your Experimental Hive, too.
I tested a DSL with a removed Model Explorer without any problems. It seems the developers of the DSL Tools did a very good job on the code generation templates . The generated ModelExplorer.cs file contains only a single line:
// This source file is empty because this DSL does not define a model explorer.
That should be a good proof that a DSL can run without the model explorer even if it might be not supported by the DSL Tools.
出处:http://www.cnblogs.com/default
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。
- Getting rid of the DSL model explorer
- Getting Rid Of Windows Rootkits
- Any chance of getting rid of the all_load requirement for the iOS framework?
- why pooling layer & Getting rid of pooling
- 剔除多余的SQL代码(Getting rid of SQL Code)
- 6 Simple Solutions for Getting Rid of Stress
- I want to get rid of the habit of siesta
- how to get rid of the UITabBarItem padding
- Getting the hang of IOPS
- Getting the dimensions of the soft keyboard
- The problem of getting ior by https
- Getting the most out of IDispatch(XYDispDriver)
- Getting The Hang Of IOPS v1.3
- Getting The Hang Of IOPS v1.3
- [torch]Getting the Output of a Layer
- The little thing of getting up early
- Object Model 之 DSL
- Get Rid of Dreadful Virus
- 教育乃立国之本:教育类开源项目大汇集
- Android AlertDialog 获取PositiveButton的控制权
- listView 与scrollView 共存
- 使用C调用lua 无法解释的外部符号
- socket编程中的read、write与recv、send的区别
- Getting rid of the DSL model explorer
- UX是什么?
- 游戏服务器的架构设计
- Hadoop 2.2.0版本HDFS的HA配置
- tcpcopy使用方法
- nginx+keepalived负载均衡可用框架(补一 keepalived安装配置-互备)
- memcache使用例子
- iOS笔试
- 高权重网站后面的共同点