K
Konrad Anton
Hello everyone,
while trying to integrate my .NET-based Visio-Add-In with the Undo
mechanism, I arrived at the following question:
If I create a shape, and the creation is done and redone as in...
Shape s = DropShapeFromSomeStencilOnThatPage();
int id = s.ID;
string guid = s.get_UniqueID(visGetOrMakeGUID);
Page page = s.Page;
app.Undo();
app.Redo();
.... and I later retrieve the logically same shape by ID...
Shape s1 = s.Page.Shapes[id];
Shape s2 = s.Page.Shapes[guid];
will then s1, s2 and s be pointer-equal, i.e. can I assume that Redo of
a Shape creation will result in a pointer-equal object such that my own
UndoItems can assume that the old s reference is still a reference to
the right Shape? My observations in the debugger suggest that it is
indeed the case, but I haven't found any promise about that in the Visio
SDK doc, I'm used to pointer-equality being an incidental implementation
artifact, and my .NET roots aren't deep enough to say "That's how it's
always been done, son".
Can anyone enlighten me?
--Konrad
while trying to integrate my .NET-based Visio-Add-In with the Undo
mechanism, I arrived at the following question:
If I create a shape, and the creation is done and redone as in...
Shape s = DropShapeFromSomeStencilOnThatPage();
int id = s.ID;
string guid = s.get_UniqueID(visGetOrMakeGUID);
Page page = s.Page;
app.Undo();
app.Redo();
.... and I later retrieve the logically same shape by ID...
Shape s1 = s.Page.Shapes[id];
Shape s2 = s.Page.Shapes[guid];
will then s1, s2 and s be pointer-equal, i.e. can I assume that Redo of
a Shape creation will result in a pointer-equal object such that my own
UndoItems can assume that the old s reference is still a reference to
the right Shape? My observations in the debugger suggest that it is
indeed the case, but I haven't found any promise about that in the Visio
SDK doc, I'm used to pointer-equality being an incidental implementation
artifact, and my .NET roots aren't deep enough to say "That's how it's
always been done, son".
Can anyone enlighten me?
--Konrad