index > Visual Studio Team System - Domain-Specific Language Tools > Non string name domain properties

Non string name domain properties


Hi,

I just tried to set as a name property for a domain class a property with a type different than String (an Integer in this case). When I did it, I got an error stating that I needed an ElementNameProvider to make this work:

Domain Property DomainProperty1 is marked IsName, but has type System.Int32. Unless it has an ElementNameProvider, the type of a Name property should be System.String.

I did create the element name provider, registered it as an external type and set it as the element name provider for this name property; the error was gone, and I could successfully generate the code for the dsl.

When I tried to create an instance of the domain class with this property, I got a different and somewhat contradicting runtime error, stating that:

"ElementNameAttribute is applied to a domain property of type other than System.String".

Are name properties other than strings supported as hinted by the design time error, or the reality is described by the runtime error message? I think it's the latter.

Thanks,

Fernando

Fernando Simonazzi

Hi Fernando,

You're correct, the runtime is right and the incorrect validation message is a bug.

I've posted a blog entry on how to do this here: http://blogs.msdn.com/garethj/archive/2006/09/29/777204.aspx




Gareth Jones - Developer - DSL Tools & Software Factories Platform [MSFT]
GarethJ - MSFT

Thanks Gareth, your blog post is very helpful.

Fernando

Fernando Simonazzi
reply 3

You can use google to search for other answers

 

More Articles

Dynamically determining link type
Providing UITypeEditor in DSL
Multiple viewpoints/ zoom in, zoom out
How to change the Name property when a Shape is droped into the d...
Tying domain classes to shape objects
Name of EventHandler called when Compartment item is selected?
Default values not stored
How to intercept shape double-click event
Using DSL tools outside VS
March CTP DSL uninstall / VS (RC) issue
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Have problem for the DSL walk-through st…
How to Block Self-Relationship
Inherited classes and their compartment …
Fail to load Designer package
How do I get a new ModelElement's corres…
Save instance of model in menu command
Licensing & pricing
DSL Toolkit and VSIP License?
Nested Shapes
Are there any Community Projects using t…
Upgrade bug: Only 8.1 version of TextTem…
geometryShape no "Diamond" Sha…
Deployment - I can't find the template
Customize DirectiveProcessor
No more RedistInstallDir registry value …

Hot Articles

Problem with List type value property
[outdated] September 2005 CTP available
Can I make two DSL models interact ?
Generating Code From a Model Walkthrough
Including code files in a DSL instance
Dynamically Create Links OnAttributeChan…
"DSL DM -> DD" for November…
I get a null reference exception when ad…
Error in "Domain-Specific Language …
reuse of model elements
Migrating custom text transformation tem…
"Static" Swimlanes
Resources: Domain Specific Language (DSL…
How to Limit Number of Connectors Betwee…
DSL and VS 2005 Release Candidate 1 ?

Recommend Articles

A minor gotcha: reserved words
Compartiment with multiple classes to be…
Can Visual Studio DSL Designers be hosted?
Xsd To DslDefinition.dsl transformation
Diagram Size
Double Click on Compartment Item
Join the World's Largest User Group on S…
Overriding custom attribute in a derived…
Instanciate an external model
Problem loading different models in Dire…
Package Load Failure
Problem Installing DSL Tools September 2…
Migrating .diagram files to V1 (Septembe…
Adding items to compartment
Unable to intercept double click on deco…