直接从形状操作调用 C# 插件方法

发布于 2024-11-27 15:16:20 字数 1097 浏览 1 评论 0原文

我有以下设置:我使用 VSTO 为 Visio 2010 编写了一个加载项,该加载项向 UI 添加了另一个功能区。通过这个用户界面,可以打开新表单并做一些很酷的事情。

使用我重写的旧版本工具,可以右键单击形状并直接从形状打开表单。这是通过向形状添加一个操作来完成的,如下所示:

=RUNADDON("VS2.EXE")

其中 VS2.exe 是打开另一个表单的可执行文件(必须位于 Visio 的搜索路径中)。

我的问题是,是否有一种简单的方法可以从形状操作内部调用加载项/功能区中的方法?类似的东西:

=RUNADDON("MyAddIn.MyMethod()")

我发现的相关信息(但没有回答这个问题)是

感谢您的回复或建议。

I have the following setting: I wrote an add-in for Visio 2010 with VSTO and this add-in adds another ribbon to the UI. From this user-interface, it is possible to open new forms and do some cool stuff.

With the elder version of the tool I rewrote, it was possible to right-click on a shape and open a form directly from the shape. This was done, by adding an action to the shape that looked like:

=RUNADDON("VS2.EXE")

where VS2.exe was the executable that opened another form (which had to be in the search-path of Visio).

My question is, if there is an easy way of calling a method in the add-in/ribbon from inside of the shape action or not? Something like:

=RUNADDON("MyAddIn.MyMethod()")

Related information I found (but didn't answer this question) were

Thanks for any reply or suggestion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花桑 2024-12-04 15:16:20

如果要从 ShapeSheet 调用外接程序中的操作,则需要使用以下两个函数之一引发事件:

QUEUEMARKEREVENT("My ContextString")
请参阅 https://msdn.microsoft.com/en-us/library/ office/ff767955.aspx

RUNADDONWARGS("QueueMarkerEvent","My ContextString")
请参阅 https://msdn.microsoft.com/EN-US/library/ office/ff768158.aspx

第一个是较新的,专门为此目的而制作。
您的外接程序需要侦听 Application.MarkerEvent 以捕获引发的事件。

Visio SDK中有示例

If you want to call an action in your add-in from the ShapeSheet, then you need to raise an event using either of the two following functions:

QUEUEMARKEREVENT("My ContextString")
See https://msdn.microsoft.com/en-us/library/office/ff767955.aspx

RUNADDONWARGS("QueueMarkerEvent","My ContextString")
See https://msdn.microsoft.com/EN-US/library/office/ff768158.aspx

The first one is newer and made specifically for this purpose.
Your add-in needs to be listening to the Application.MarkerEvent to capture the raised events.

There are examples in the Visio SDK

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文