|Drop on shape using IMoveFeature [message #766010]
||Thu, 15 December 2011 04:15
| Patrick Talbot
Registered: November 2011
I'm trying to code a behavior where a user can drop PictogramElements on a Shape that is actually a link to another diagram (what I call a Subgraph).
I successfully achieved simulating the drop of elements using MoveFeature implementations for my various elements. These MoveFeature(s) are capturing the element, creating a new one on the related diagram, and removing the source element from the source diagram.
All is well, except that I would also like to move Connections to that other diagram if both ends of the connection are part of the current selection. This is where it gets hairy...
I can check that the 'other' end of a connection is part of the selection, but the problem is that I cannot know the order of the calls to my various MoveFeature(s).
So when I try to move the connection, the other end is not there already in the target diagram. And since I need to remove the elements as I go along (I have no hook to a final 'move events' where I would probably add the connections and remove the elements from the source), when I get to the second element, it's connection is no longer valid...
Not sure if I'm clear enough but basically, I'm wondering if there is another way to do that or whether I could use a global Feature that would work on the entire selection as a whole. A CustomFeature is not called on move, so where could I trigger my behavior on a whole selection?
Any ideas anyone?
Thanks for your help,
Powered by FUDForum
. Page generated in 0.02145 seconds