Me n My Programming

If Only I Have TIme

How to get Element ID in DSL

I was populating my graph with the node from my DSL when I notice that some of the node have same name (although there belong to different actor). I was thinking to use the node name as key to my graph and obiviously it can’t anymore. I try to concat the actor name with the node name but stumble upon another problem. I look through the XML file (for the sample DSL) and came across an attribute name ID.

Ah, each node have a unique ID. I was strugling for three days on how I can get the element ID. At last I manage to do it. To think about it, it just so simple. Here is the code:

Let say your Domain Class name is Task.
You draw an object name t1.

id = t1.Id(); or
WriteLine(t1.Id.ToString());

Click here for link to MSDN.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on March 24, 2009 by in Uncategorized and tagged , .
%d bloggers like this: