Closed RomainBL closed 9 years ago
Hi Romain,
The usual way that DomNodeAdapters initialize themselves when the DomNode is copied is to override OnNodeSet() and then initialize their fields from the DomNode's data (attributes and/or children).
If that doesn't work for you, then you might need a custom implementation of IInstancingContext
.
I think of DomNodeAdapters as the "business class" that offers a custom view of a DomNode's data in a convenient way. If the DomNodeAdapter starts having its own data that is independent of the DomNode, then you will have to have special handling for persistence and copy/paste and undo/redo, because you have data that is not observable in the DOM.
--Ron
Hello,
I have found the function Copy() in the DomNode class which clone only attributes.
In my case I would like to copy a member in a DomNodeAdapter object when a DomNode is copied.
What is the best way to implement this ?
I was thinking of implementing an ICopy or IClone Interface for DomNode Adapter and loop through all the adapter in the DomNode Copy func. But I am not sure if this is the best way for the ATF framework.
Cheers. Romain.