Book a Demo

Author Topic: Properties Code Generation C#  (Read 4808 times)

DJ_Doena

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Properties Code Generation C#
« on: June 10, 2005, 03:26:40 am »
Hi,

I tried to generate a property in an interface. To do so, I have to define a member in the interface which won't be generated in the c# interface file (that's correct).

If I design a class which implements this interface the getter and setter will be generated. Unfortunately the methods try to access a member variable, which is not generated.

Of course I could define a operation with the (not in list) stereotype "property". But then I can't define a readonly/writeonly property anymore, because this windows is only accessable over the member (attribute) window

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Properties Code Generation C#
« Reply #1 on: June 21, 2005, 05:49:52 pm »
You can add a tagged value "readonly" or "writeonly" with a non-empty value to your operation.

DJ_Doena

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Properties Code Generation C#
« Reply #2 on: July 04, 2005, 01:28:43 am »
Quote
You can add a tagged value "readonly" or "writeonly" with a non-empty value to your operation.

Could you please explain what you mean by that?

Thank you in advance.

thomaskilian

  • Guest
Re: Properties Code Generation C#
« Reply #3 on: July 04, 2005, 01:41:15 am »
Add a tag named "readonly" of type string. Assign it the value "it is really nice" (or better "true"  ;))

DJ_Doena

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Properties Code Generation C#
« Reply #4 on: July 08, 2005, 02:00:18 am »
Quote
Add a tag named "readonly" of type string. Assign it the value "it is really nice" (or better "true"  ;))



Aaah, thank you very much!