Book a Demo

Author Topic: Duplicated "using" (header) directives  (Read 3401 times)

joyce

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Duplicated "using" (header) directives
« on: May 28, 2004, 01:51:09 pm »
Hello, can't for the life of me fathom why EA is doing this, but for about 67 of 150 classes when I generate fresh code, it duplicates one of the header directives (actually it's c# and it's a using directive).

I.E. in the Generate Code dialog in the Import(s)/Header(s) edit box I have the following:
using System;
using System.Data;
using CSLA.Data;
using CSLA;


The source code generated is this:
using System;
using System.Data;
using CSLA.Data;
using CSLA;

using CSLA;


With that extra line break and duplicate of the using CSLA line at the bottom which causes an annoying compilation warning and shouldn't be there on principle.

Doesn't seem to matter what I change in the uml class diagram, even if I put in a different using directive in teh UML class properties after that CSLA one, it puts the same CSLA one in again.

Anyone run into this before?

It's preventing us from generating code very often because we have to manually remove that line from a lot of files.
« Last Edit: May 28, 2004, 01:52:57 pm by JCardinal »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Duplicated "using" (header) directiv
« Reply #1 on: May 30, 2004, 06:11:55 pm »
Hi ,

The problem is that EA is outputting what you put in that field, and also creating using statements for classes that are used in the model.

The Imports edit box is intended to allow you to make EA generate imports for things that aren't in the model.

I realise that this isn't the best behaviour, and I'm sure it will be dealt with at some point, I just can't say when at this stage.

If you want to get only one appropriate using statement then you will need to take it out of the imports edit box.

Simon