Author Topic: .NET partial classes  (Read 3410 times)

Ricardo Guerra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
.NET partial classes
« on: March 09, 2009, 09:54:26 pm »
Hi there,

EA duplicates UserControls partial classes that have a .Designer.cs file when using the Import Source feature. Is there a way to avoid this or to remove them after generation ?

Thanks in advance!

Cheers,
Ricardo

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: .NET partial classes
« Reply #1 on: March 10, 2009, 12:13:41 am »
Not in 7.1, and I don't know whether this might changed for 7.5 production (I just have not checked in the beta versions).

At least EA will handle partial classes properly when forward engineering.

Search the forum for a few suggestions on how to work with this paradigm, as well as some of the limitations you must respect.

I know this is not the answer you are hoping for, but it might at least save you some lost time looking for a solution that is not there.

David
No, you can't have it!

Ricardo Guerra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: .NET partial classes
« Reply #2 on: March 10, 2009, 12:56:31 am »
Yes, we are using 7.1...

I was thinking to automate the duplicate objects after reverse engineering but that might be error-prone...

By the way i couldnt find anything on the forum related to this subject...

Thanks
« Last Edit: March 10, 2009, 12:58:33 am by rj-guerra »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: .NET partial classes
« Reply #3 on: March 10, 2009, 09:24:11 pm »
You have to dig a bit to find the forum posts, but they exist. Sorry, but I cannot think of any 'exotic' keywords that might narrow the search.

I think you could write an automation tool that would clean things up a bit. Yes, it might be error prone, but only to the extent that you would need to be careful with partial classes when programming (the classes themselves).

There are some other ways to handle this, at least as far as presentation is concerned. Whether EA would handle them gracefully is something you would need to test for yourself. For example, perhaps you could create a composite element - either use one of the partial class components or create a new element - and make it composite. Drag the (remaining) components of the partial class to the 'inner' class diagram. Now you have a neater appearance on the original diagram, while preserving the partial components. As I say, you'd have to test this. I have not tried it myself.

David
No, you can't have it!

Ricardo Guerra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: .NET partial classes
« Reply #4 on: March 12, 2009, 08:10:12 pm »
Thanks for your reply Midnight!