この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
AddIns インターフェイス
DTE.AddIns の場合は、[アドイン マネージャー] ダイアログ ボックスに表示されるすべてのアドインを含みます。ProjectSolution.AddIns の場合は、特定のソリューションによって読み込まれるすべてのアドインを含みます。
アセンブリ: EnvDTE (EnvDTE.dll 内)
AddIns 型で公開されるメンバーは以下のとおりです。
| 名前 | 説明 | |
|---|---|---|
|
Count | AddIns コレクション内のオブジェクトの数を示す値を取得します。 |
|
DTE | トップレベルの機能拡張オブジェクトを取得します。 |
|
Parent | AddIns コレクションの直接の親オブジェクトを取得します。 |
| 名前 | 説明 | |
|---|---|---|
|
Add | 特定のソリューションの読み込み時に読み込まれたアドインのコレクションにアドインを追加します。 コレクションが DTE.AddIns コレクションである場合は失敗します。 |
|
GetEnumerator() | コレクションを反復処理する列挙子を返します。 (IEnumerable から継承されます。) |
|
GetEnumerator() | コレクション内の項目の列挙子を取得します。 |
|
Item | AddIns コレクション内の AddIn オブジェクトを返します。 |
|
Update | コレクションを更新して、[アドイン マネージャー] ダイアログ ボックスを開いたり、またはオブジェクトのウィンドウ レイアウトを現在のウィンドウ レイアウトに設定したりするのと同様にします。 |
AddIn オブジェクトは、アドインに関する情報を他のアドインに提供します。 登録されたアドインだけが AddIn オブジェクトによって表されます。
アドインがソリューション アドインである場合を除き、IDTExtensibility2 インターフェイスには AddIns コレクションの更新時に発生する OnAddInsUpdate メソッドが含まれます。
Sub AddInsExample() ' For this example to work correctly, there should be an add-in ' available in the Visual Studio environment. ' Set object references. Dim addincoll As AddIns Dim addinobj As AddIn ' Register an add-in, check DTE add-in count before and after the ' update. addincoll = DTE.AddIns MsgBox("AddIns collection parent name: " & addincoll.Parent.Name) MsgBox("Number of Add-ins: " & addincoll.Count) ' NOTE: Use regsvr32 for Visual C++, regasm for Visual Basic ' and Visual C#. Also, the pathname used below is an example only. Shell("regasm F:\AddIns\RegExplore\Debug\regexplore.dll") addincoll.Update() MsgBox("Number of Add-ins: " & addincoll.Count) addinobj = addincoll.Item(1) End Sub