Book a Demo

Author Topic: C# does not seem to generate all Using statements.  (Read 2884 times)

fredhirschfeld

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
C# does not seem to generate all Using statements.
« on: February 04, 2004, 07:54:59 am »
I have been trying to figure out how to get my very simple model to generate the proper
  Using {namespace};
line when I have a custom return type that is in a different package.

I have tried to use all forms of linking but it only seems that Associations will cause the statement to be included. I only want to use the Dependency as I am using an Interface as the return type.

I also tried to simply link the package containing the interface and that did not seem to help either. When generating code I always delete the previous file first.

Another question is how do I get the .NET Framework in the model so those imports are done as well?

Fred
« Last Edit: March 22, 2004, 03:25:04 pm by Newman »

fluxtah

  • EA User
  • **
  • Posts: 144
  • Karma: +0/-0
    • View Profile
Re: C# does not seem to generate all Using stateme
« Reply #1 on: February 04, 2004, 09:20:24 am »
I get this prob also :(

Also when I try to link the class to the package with realization that contains the interface, i managed to achieve the following code but it is missing the package path the class realizes

Code: [Select]
///////////////////////////////////////////////////////////
//  Class1.cs
//  Implementation of the Class Class1
//  Generated by Enterprise Architect
//  Created on:      04-Feb-2004 16:27:29
///////////////////////////////////////////////////////////




using ; // <---- EA did not insert the realized package path


namespace test {
     public class Class1 {

           public Class1(){

           }

           public IPermission FooBar(){

           }

     }//end Class1
}//end namespace test

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: C# does not seem to generate all Using stateme
« Reply #2 on: February 10, 2004, 07:33:21 pm »
Hi Fred and Fluxtah.

Thanks for your comments.

The dependancy link won't do it. As raised in the earlier post, it should be sufficient that the AcquireSession operation specifies the ISession classifier as the return type. We will aim to support generation of using statements based on this.

Regards,
Ben