Book a Demo

Author Topic: C# Custom Attributes  (Read 3117 times)

wombat

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
C# Custom Attributes
« on: July 14, 2004, 11:30:02 pm »
I've been using EA for almost half a year now and pretty happy with with.  My current version is 4.10.731

I have a problem with C# code generation whereby EA clobbers my custom attribute tag.  for example, EA first
generates a class that looks like this:

class A
{
 private int _myI;
 public int  MyI
 {
    get
    {
       return _myI;
    }
    set
    {
       _myI = value;
    }
}

Now if i then insert some custom attributes on top of the generated MyI property, that looks like this:
class A
{
 private int _myI;

 [MyCustomAttribute()]
 public int  MyI
 {
    get
    {
       return _myI;
    }
    set
    {
       _myI = value;
    }
}
then regenerate the code with the 'synch' option - my custom attribute dissappear - is there a way to stop this from happening???  Or is there away for me to insert custom attribute in EA model?


I prefer the 2nd option - ie inserting custom attribute in EA


Thanks.

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: C# Custom Attributes
« Reply #1 on: July 19, 2004, 03:17:05 am »
The default CGT's provide for this already. Just add a Class/Interface level tag named:
 Attribute
and give it a value of:
 [MyCustomAttribute()]