2011-11-23 47 views
0

我正在開發簡單的VS 2008插件。
現在我只能自動生成基本自動生成文件的代碼。
這是「TestsGenerator - 對於Testing.AddIn」文件:第一次點擊後Visual Studio 2008 Addin消失

<?xml version="1.0" encoding="UTF-16" standalone="no"?> 
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility"> 
    <HostApplication> 
     <Name>Microsoft Visual Studio Macros</Name> 
     <Version>9.0</Version> 
    </HostApplication> 
    <HostApplication> 
     <Name>Microsoft Visual Studio</Name> 
     <Version>9.0</Version> 
    </HostApplication> 
    <Addin> 
     <FriendlyName>CSUnit tests generator</FriendlyName> 
     <Description>Generates tests for csUnit basing on TestingTable.xml file</Description> 
     <Assembly>D:\Nova\dev\RecipeConverter\Sources\TestsGenerator\bin\TestsGenerator.dll</Assembly> 
     <FullClassName>TestsGenerator.Connect</FullClassName> 
     <LoadBehavior>0</LoadBehavior> 
     <CommandPreload>1</CommandPreload> 
     <CommandLineSafe>0</CommandLineSafe> 
    </Addin> 
</Extensibility> 

我成功調試代碼,當我運行在F5的項目。現在,這裏是功能列表通話後,我按F5:

構造函數()
的onConnect()

我上加載項的按鈕按下工具菜單:

的onConnect()
執行exec()

AND !!!按鈕從工具菜單desapears!
有人可以告訴我爲什麼發生!?
謝謝你的提前。

回答

0

好的,事實並非所有的文件都是自動生成的,我從另一個加載項中獲得了部分文件。
任何方式。雖然外接連接類的全名是:TestsGenerator.Connect的QueryStatus功能看起來像:

public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) 
{ 
    if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone) 
    { 
     if (commandName == "MyAddin2.Connect.MyAddin2") 
     { 
      status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled; 
      return; 
     } 
    } 
} 

後,我下面的一切都變了條件開始工作:

if (commandName == "TestsGenerator.Connect.MyAddin2") 
相關問題