Book a Demo

Author Topic: Reverse engineering partial classes (C#)  (Read 2935 times)

Eiberle

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Reverse engineering partial classes (C#)
« on: October 26, 2011, 03:54:23 pm »
Hello all,

I am currently facing the problem of reverse engineering a c# class which has been split into several partial classes. Each class resides in its own file, for example

LittleHelper_main.cs
Code: [Select]
public partial class LittleHelper
{
  public void Foo()
  {
     // -- Some code
  }
}

LittleHelper_Ext.cs
Code: [Select]
public partial class LittleHelper
{
  public void DoIt()
  {
     // -- Some code
  }
}

and so on.

These two code files are building together the LittleHelper class, so I have expected that the reverse engineering would handle the partial keyword and generate one class containing both methods. But it turns out, that two classes have been generated, both with the same name but one class containing the Foo() function and the other containing the DoIt() function.

Has anybody an idea how to tell EA that partial classes must form only one class? Merging both files into one file is not possible.

I am using EA Build 909 and the most recent VisualStudio integration. I am using VisualStudio 2010, and the application is built on .NET 3.5 SP1.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Reverse engineering partial classes (C#)
« Reply #1 on: October 26, 2011, 04:45:23 pm »
EA imports each part as a separate class element with a "partial" tagged value.  This is necessary to support round-trip code engineering with each partial file.  Unfortunately there is no way to import all parts as a single class at this time.