Book a Demo

Author Topic: How can I add using statements in c#?  (Read 2902 times)

tone

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
How can I add using statements in c#?
« on: September 14, 2010, 12:19:09 am »
What do I need to add to a class in the EA model in order to generate a using (imports) statement in c#?  I have tried reverse engineering a class with a using statement but do not see the using statement i added in the EA model.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How can I add using statements in c#?
« Reply #1 on: September 14, 2010, 08:27:32 am »
Using statements are generated from usages of classes (as attribute classifiers etc.)

To generate using statements for classes not in your model they can be specified in the code generation dialog (for a single class).

tone

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: How can I add using statements in c#?
« Reply #2 on: September 14, 2010, 09:03:54 am »
ok i see.  Seems to work fine.  Is there any way to apply a single using/imports to multiple classes at once?

VGermscheid

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: How can I add using statements in c#?
« Reply #3 on: September 21, 2010, 08:46:31 am »
I did this by changing the Import template so that common includes (e.g. using System;, etc.) get added to every class.

Quote
ok i see.  Seems to work fine.  Is there any way to apply a single using/imports to multiple classes at once?