为 studio 2008 创建插件

发布于 2024-09-29 11:39:00 字数 266 浏览 1 评论 0原文

我正在尝试为 Visual Studio 创建一个简单的 C# 插件。我一直遵循网上的指南,它说将我的主要代码放在名为“Exec”的例程中。

但是,我在任何地方都找不到这个例程。我假设应该有一个存根。 我所拥有的只是一个 connect.cs,其中包含 Onconnection、OnDisconnection、OnAddinsUpdate、OnStartUpComplete、OnBeginShutDown。

我想做的就是用一个按钮打开一个表单。

谢谢你们。 克里斯.

I'm trying to create a simple c# addin for visual studio. I've been following the guidelines dotted around the net, and it says to put my main code in a routine called 'Exec'.

However, I cannot find this routine anywhere. I'm assuming there should be a stub for this.
All I have is a connect.cs, with Onconnection, OnDisconnection, OnAddinsUpdate, OnStartUpComplete, OnBeginShutDown.

All I want to do is open one form with a button.

Thank you guys.
Chris.

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

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

发布评论

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

评论(1

明天过后 2024-10-06 11:39:00

是的,您应该具有如下所示的 exec 方法:

public void Exec(string commandName, EnvDTE.vsCommandExecOptionexecuteOption, ref object varIn, ref object varOut, ref bool Handling)
{
handler = //这里是你的方法,例如。
返回;

据我正确记得,此方法来自连接继承的某个接口或抽象 COM 类,但我不确定,因为我不在 VS2005/2008 ATM 上

尝试自己添加该方法。

Yes you should have the exec method that looks like so:

public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
handled = //your method here for eg.
return;
}

As far as i remember correctly this method comes from some interface or abstract COM class that connection inherited but i'm not sure as i'm not on the VS2005/2008 ATM.

Try adding the method yourself.

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