Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Fehma on August 02, 2011, 12:03:53 am

Title: C#  Add Property to Attribute
Post by: Fehma on August 02, 2011, 12:03:53 am
Hi there,

I actually created a Class with an Attribute via c# without a Problem.
Now I want to mark this Attribute as Property and also provide the PropertyName.


Any Ideas ?

Greetings

Marcus
Title: Re: C#  Add Property to Attribute
Post by: Geert Bellekens on August 02, 2011, 05:01:22 am
Marcus,

Do the necessarily in EA, and then check in the database what changed.
That is usually the best way to figure out these things.

Geert
Title: Re: C#  Add Property to Attribute
Post by: Fehma on August 02, 2011, 05:47:14 pm
Hi Geert ,

thank you very much for your answer. I have actuall tried it and I saw ( your addons helped me a lot :-) ) that the only value it set on t_attribut was GenOption with the value PROPERTY=testContextInstance;

But on EA.Attribut there is now way to set GenOption...

Any Idea ?

Greetings

Marcus
Title: Re: C#  Add Property to Attribute
Post by: Geert Bellekens on August 02, 2011, 06:07:54 pm
Marcus,

I would check the values in Style and StyleEx. If those don't contain the values you are looking for then I'm afraid they only option you have is to go to the database directly.
Use Repository.SQLQuery() for retrieving and Repository.Execute() for updates.

Geert
Title: Re: C#  Add Property to Attribute
Post by: Fehma on August 02, 2011, 06:11:11 pm
Geert,

again tons of thx for the quick answer..
I guess I have to go for the SQL Solution .

Greetings

Marcus
Title: Re: C#  Add Property to Attribute
Post by: Fehma on August 02, 2011, 07:40:12 pm
hmmm I found SQlQuery but I can't find Repository.Execute()

Geert any Ideas where I can find the Execute Function ?

Greetings
Title: Re: C#  Add Property to Attribute
Post by: Geert Bellekens on August 02, 2011, 08:43:23 pm
It's there trust me, it's just a hidden operation.
Try it out and you'll see

Geert
Title: Re: C#  Add Property to Attribute
Post by: Fehma on August 02, 2011, 08:49:30 pm
he he  ;D

it is working.....

Tons of thx....

Marcus