在我的自定義DSL工具中,我想要一個無法刪除的資源管理器中的節點。除此之外,我希望它像一個常規節點。基本上我想要的是像在DSL資源管理器中XML序列化行爲節點:DSL Explorer中的永久節點
通過使用上的Microsoft.VisualStudio.Modeling.Sdk.DslDefinition.dll組裝我的XmlSerializationDefinitionSerializer類反射發現它只是DomainClass的一個衍生物,所以沒有什麼(顯然)特別的。
我已經定義了一個作爲節點的DomainClass,並且右鍵點擊它可以讓我按照我希望的方式添加子節點,但我無法擺脫Delete菜單選項:
Delete context menu item illustration http://img705.imageshack.us/img705/9033/validators.png
我已經試過什麼,我能想到的......我給自己定的屬性setter給私人,它會解決這個問題,我已經設置了多重性爲1..1,有沒有效果,而不是在「Validators」節點丟失時給出錯誤......我查看了DomainClass和DomainRelationship在根模型和Validators Domain Class之間的所有屬性,它們都沒有處理這個問題。我還查看了「DSL資源管理器」窗口的「瀏覽器行爲」節點中的所有內容。我完全被難住了。有人知道怎麼做這個嗎?
+1。做得很好。我喜歡DSL工具,它很好,你已經回答了這個問題。 – 2009-12-17 22:40:57