Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: zaknixon on April 14, 2008, 11:45:56 pm
-
Can one set the private class variables that are get/set by a C# property, just by declaring it in EA instead of writing the actual code ?
-
Yes,
Open the Tools | Options |Source Code Engineering dialog. Take a look at the section about 2/3 of the way down, starting with "Remove prefixes when generating Get/Set properties."
David
-
So, EA will define my private instance variables that match with a property field, and I can't link my own if I already defined it ?
-
I'm not sure exactly what you mean.
For new attributes, create the attribute with a listed prefix, something like m_myAttribute. Save the attribute, then click the Property box - the box will not be enabled until you save the attribute.
You'll receive a dialog that will provide you with options (read/write etc.) and show you the property name, in the default case it would be MyAttribute.
As to what you've done so far, you will likely have to edit by hand, but I cannot be sure. Perhaps the same Property can be used to 'attach' a property you have already created; I just have not tried.
David
-
If you already have an attribute and property. Open the tagged values for the property method and add one "attribute_name" and give it the name of the attribute used.