I need to check that all the unsaved progress from Visio is in the UTF-8 encoding before I save the document. The reason I need this, is because the xml data is encoded in UTF-8 and I have people using the plugin in many different languages that can cause problems.
I use the event to trigger the Method:
this.Application.BeforeDocumentSave += new Visio.EApplication_BeforeDocumentSaveEventHandler(Visio_BeforeDocumentSave);
private void Visio_BeforeDocumentSave(Visio.Document doc) //Ensure UTF-8 encodeing before save
{
if (!doc.Saved)
{
}
}
I noticed that people suggested to iterate through all shapes and pages to check encoding, but considering the size of the document this will take unnecessarily long amount of time.
Therefore I wonder if there is a way to collect all unsaved progress from the Application, so I can at least skip data that is already saved and safe.
private void Visio_BeforeDocumentSaveAs(Visio.Document doc)
{
// doc.Saved checks if there is unsaved progress in the visio app
// Is there also a way to retrieve this data that doc.Saved is referring to
}
Any suggestions is welcome, even if it changes my approach to the "problem".
I need to check that all the unsaved progress from Visio is in the UTF-8 encoding before I save the document. The reason I need this, is because the xml data is encoded in UTF-8 and I have people using the plugin in many different languages that can cause problems.
I use the event to trigger the Method:
this.Application.BeforeDocumentSave += new Visio.EApplication_BeforeDocumentSaveEventHandler(Visio_BeforeDocumentSave);
private void Visio_BeforeDocumentSave(Visio.Document doc) //Ensure UTF-8 encodeing before save
{
if (!doc.Saved)
{
}
}
I noticed that people suggested to iterate through all shapes and pages to check encoding, but considering the size of the document this will take unnecessarily long amount of time.
Therefore I wonder if there is a way to collect all unsaved progress from the Application, so I can at least skip data that is already saved and safe.
private void Visio_BeforeDocumentSaveAs(Visio.Document doc)
{
// doc.Saved checks if there is unsaved progress in the visio app
// Is there also a way to retrieve this data that doc.Saved is referring to
}
Any suggestions is welcome, even if it changes my approach to the "problem".
It's not possible to get any extra information about what's unsaved in the Visio Application without making a custom method for it, by doing a full file comparison.