Book a Demo

Author Topic: Serialize EA.IDualPackage, EA.IDualElement  (Read 3371 times)

rvaldes

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Serialize EA.IDualPackage, EA.IDualElement
« on: July 14, 2010, 04:49:59 am »
Hi!

im developing an add in on c# language and im trying to incorporate copy and paste of packages and elements into the tree structure of an ea project.

First problem here is that AI does not provide constructors for classes derived from EA.IDualPackage and EA.IDualElement (all work is done throught collections Packages and Elements).

I thought about doing deep copy of objects using serialization but classes derived from those interfaces are wrapped into 'System.__ComObject' at runtime and throw exception because this type is not marked as serializable.

Is there any workaround for this? Using windows clipboard maybe?

Thanks in advance for your suggestions

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Serialize EA.IDualPackage, EA.IDualElement
« Reply #1 on: July 14, 2010, 05:37:57 pm »
I'm afraid the only option you have is to create the objects in the packages/elements collection and copy all attributes one by one. :(

Geert