Detecting when a shape is about to be copied?

V

v.bodurski

The application I'm working on is:
using Visio 2003 ActiveX control embedded within .NET program (written
in C#).

Currently I'm using EnterScope to detect the occurence of the following
events:
visCmdUFEditCopy
visCmdUFEditCut
visCmdUFEditDuplicate
visCmdDragDuplicate
But the problem which hinders my usage of this method is that
EnterScope
event is raised when the operation has already been completed.
The reason for my need to intervene before the shape is
copied/duplicated/cut
is:
For all shapes (which are not 1D) I have a separate DataSet with some
info. That info is available to the user for editing, this info is
stored within the corresponding shape, as XML, so that the created
configuration
can be saved just as a .vsd file and later restored by the program.
So when a user makes a change to the DataSet I'm trying to determine
the events which
require that the DataSet to be written into the shape. My other option
is to
actually synchronize the DataSet to the shape's XML after each
modification
done by the user, but this is something I'd prefer to leave as a last
resort.
 
V

v.bodurski

Well in order to modify the shape's configuration contained within the
DataSet the
shape has to be selected too, so the scenario I'm trying to handle is:
1. the user selects the shape
2. makes changes to the DataSet
3. copies the shape
at this point the shape which is in the clipboard will actually contain
older version of the
data in its XML config.
 
A

Al Edlund

I was just wondering if starting enter EnterScope sooner (when it is
selected) might be an option. At least you have the opportunity to catch the
copy request sooner.
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top