为 studio 2008 创建插件
我正在尝试为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您应该具有如下所示的 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.