この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
AddIn インターフェイス
[アドイン マネージャー] ダイアログ ボックスに表示されるアドインを表し、アドインに関する情報を他のアドイン オブジェクトに提供します。
アセンブリ: EnvDTE (EnvDTE.dll 内)
AddIn 型で公開されるメンバーは以下のとおりです。
| 名前 | 説明 | |
|---|---|---|
|
Collection | このプロパティをサポートしている AddIn オブジェクトを含むコレクションを返します。 |
|
Connected | アドインが読み込まれ、関連付けられているかどうかを示す値を取得または設定します。 |
|
Description | AddIn オブジェクトの記述を表す文字列を取得または設定します。 |
|
DTE | トップレベルの機能拡張オブジェクトを取得します。 |
|
Guid | AddIn オブジェクトの GUID を取得します。 |
|
Name | AddIn オブジェクトの名前を取得します。 |
|
Object | 指定した AddIn オブジェクトをサポートするオブジェクトを設定または取得します。 |
|
ProgID | アドインのレジストリ エントリに基づく ProgID を取得します。 |
|
SatelliteDllPath | ローカライズされたリソースを含む DLL を利用できる場合に、その DLL の場所を取得します。 |
Sub AddInExample() ' 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) ' Connect the add-in if it is not already connected ' and list its SatelliteDLLPath and Guid. If addinobj.Connected = False Then addinobj.Connected = True End If MsgBox("Satellite DLL Path: " & addinobj.SatelliteDllPath) MsgBox("DLL GUID: " & addinobj.Guid) ' Activates a solution add-in so that it is available, then ...' deactivates it. addinobj = DTE.Solution.AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False) DTE.Solution.AddIns.Item(1).Remove() End Sub