简体   繁体   English

VSTO 加载项事件处理程序

[英]VSTO add-in event handler

In Shared add-in the following event handler code for add-in start up is as follows:在共享加载项中,加载项启动的以下事件处理程序代码如下:

Public Sub OnStartupComplete(ByRef custom As System.Array) _
 Implements Extensibility.IDTExtensibility2.OnStartupComplete
End Sub

In VSTO it was replace with在 VSTO 中,它被替换为

Private Sub ThisAddIn_Startup() Handles Me.Startup
End Sub

Is there anyway to create event handler equivalent for VSTO without using extensibility无论如何在不使用可扩展性的情况下为 VSTO 创建等效的事件处理程序

Public Sub OnAddInsUpdate(ByRef custom As System.Array) _
 Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Thanks.谢谢。

VSTO wraps the IExtensibility2 interface completely and it doesn't expose that AddinsUpdate callback (not publicly, but I believe it DOES intercept it internally). VSTO 完全包装了 IExtensibility2 接口,并且它没有公开 AddinsUpdate 回调(不公开,但我相信它确实会在内部拦截它)。

You might compile, then run reflector to reverse engineer the VSTO code that implements IExtensibility.您可以编译,然后运行反射器对实现 IExtensibility 的 VSTO 代码进行逆向工程。 I did that at one point to figure out how to hook into the "GetUI" Extensibility callback so I could push out custom Backstage XML from a VSTO 2008 addin (Backstage view isn't directly supported by Vsto2008).我曾经这样做是为了弄清楚如何挂钩“GetUI”可扩展性回调,这样我就可以从 VSTO 2008 插件中推出自定义 Backstage XML(Vsto2008 不直接支持 Backstage 视图)。

But I didn't notice/look for the AddinsUpdate call back.但我没有注意到/寻找 AddinsUpdate 回调。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM