Persisting Visio masters

N

nbelyh

I mean, I need to persist Visio masters outside of the Visio drawings,
and be able to drop those saved masters afterwards back to the
drawings. How do I do that?

How do I serialize/deserialize Visio master to/from a stream?
How this is implemented in ShapeStudio?
 
P

Paul Herber

I mean, I need to persist Visio masters outside of the Visio drawings,
and be able to drop those saved masters afterwards back to the
drawings. How do I do that?

How do I serialize/deserialize Visio master to/from a stream?
How this is implemented in ShapeStudio?

Look at XML in the Visio help and SDK.
 
N

nbelyh

Paul, thank you for the response.
Look at XML in the Visio help and SDK.

Please, can you be more concrete?
I know, XML and open formats are great, but what relation does it have
to my question..?

I do NOT want to generate masters/drawings with XML... this is NOT the
intention.
I want to persist already existing masters (created by users).
Just like the ShapeStudio does.
(it persists masters to the database, in table "Masters" as BLOBs)

How can XML help here?

Kind regards, Nikolay K. Belyh
 
N

nbelyh

Just to let the community know that the subject is possible.
Namely, it is possible to store master/shape in a stream and then drop
it back to the document.
The way this can be implemented:

- Query master or shape you want to persist for IDataObject interface.
- Using this interface, obtain data blob in "Visio 11 Shapes/Visio 11
Masters" clipboard format (for Visio 2003).

Now this blob can be stored any way you want (database/memory/
whaever).
To drop it back to the drawing, you can use "Drop" functions of visio
document/page.
It turns out that these functions are happy enough with IDataObject
interface passed in.
So, to drop the stored master or shape back to the drawing:

- Create you own object that implements IDataObject interface.
- Pass this object in one of those "Drop" functions,
- When asked for the data, return your stored data blob in that visio
format.

It works :)
But maybe there is an easier way to do all this stuff?

Kind regards,
Nikolay K. Belyh
 

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