Pablo Galiano : How do I get a model element name property without using reflection / TypeDescriptor

Subscriptions

<November 2009>
SuMoTuWeThFrSa
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

News

Subscribe to Pablo Galiano by Email

Post Categories

How do I get a model element name property without using reflection / TypeDescriptor

My seventh How do I is up.

Scenario

This is a simpler requirement, we need to obtain a model element name property. But instead of using reflection or the type descriptor class, we need to obtain it by using the "Is Element Name" domain property. The focus of this How do I tackles this scenario.

 

Interfaces and classes needed

 

Code snippet

    string name;

    DomainClassInfo.TryGetName(modelElement, out name);

 

    //Or

    string name = DomainClassInfo.GetName(modelElement);

 

Assemblies needed

  • Microsoft.VisualStudio.Modeling.Sdk

 

Stay tuned,

Pablo

posted on Thursday, August 21, 2008 8:45 AM by pga

# Extensibility How do I #7 by Pablo @ Friday, August 22, 2008 2:02 AM

Pablo publishes another how do I, this time DSL related How do I get a model element name property without

Anonymous