admin管理员组文章数量:1400128
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".
Share Improve this question edited Mar 26 at 8:41 DanTheMan asked Mar 25 at 10:46 DanTheManDanTheMan 175 bronze badges 4- It is not clear what your problem actually is? UTF-8 encoding allows all languages that are available on this planet, including ancient languages. Maybe you mean something else? Could you explain the real problem? Without mentioning UTF8. Your post looks like a typical XY-problem (en.wikipedia./wiki/XY_problem) – Nikolay Commented Mar 25 at 16:28
- @Nikolay, when it comes to Unicode there are still languages that aren't fully supported. My problem is conversion between UTF16 -> UTF8, which is not the problem in this post. I will update clarify. – DanTheMan Commented Mar 26 at 8:32
- Visio file (VSDX) is a ZIP (binary) file; therefore, what you mean by Unicode encoding and UTF stuff is unclear. UTF8 and UTF16 both support the same set of characters (full Unicode range). You cannot do anything with the output file form "OnBeforeDocumentSave" event. Summarizing: what is your real issue? Please update. – Nikolay Commented Mar 26 at 11:35
- Let me try to ask like this: do you want to prevent any "non-ASCII" (i.e. non-English) characters to present in the shape text (or some shape properties)? Note this is not related to Unicode or UTF8 or UTF16. – Nikolay Commented Mar 26 at 13:44
1 Answer
Reset to default -1It'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.
本文标签: C InteropVisioIs there a way to collect unsaved progress from the ApplicationStack Overflow
版权声明:本文标题:C# Interop.Visio | Is there a way to collect unsaved progress from the Application? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744202801a2595046.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论