Dela via


AddIns Interface

Contains all add-ins listed in the Add-In Manager dialog box if they are DTE.AddIns, or all of the add-ins loaded by a particular solution if they are ProjectSolution.AddIns.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
<GuidAttribute("50590801-D13E-4404-80C2-5CA30A4D0EE8")> _
Public Interface AddIns _
    Inherits IEnumerable
[GuidAttribute("50590801-D13E-4404-80C2-5CA30A4D0EE8")]
public interface AddIns : IEnumerable
[GuidAttribute(L"50590801-D13E-4404-80C2-5CA30A4D0EE8")]
public interface class AddIns : IEnumerable
[<GuidAttribute("50590801-D13E-4404-80C2-5CA30A4D0EE8")>]
type AddIns =  
    interface
        interface IEnumerable
    end
public interface AddIns extends IEnumerable

The AddIns type exposes the following members.

Properties

  Name Description
Public property Count Gets a value indicating the number of objects in the AddIns collection.
Public property DTE Gets the top-level extensibility object.
Public property Parent Gets the immediate parent object of a AddIns collection.

Top

Methods

  Name Description
Public method Add Adds an add-in to the collection of add-ins loaded when a particular solution loads. It fails if the collection is the DTE.AddIns collection.
Public method GetEnumerator Gets an enumerator for items in the collection.
Public method Item Returns an AddIn object in an AddIns collection.
Public method Update Updates the collection as if the user opened the Add-in Manager dialog box, or sets the object's window layout to the current window layout.

Top

Remarks

An AddIn object provides information about an add-in to other add-ins. Only registered add-ins can be represented by an AddIn object.

The IDTExtensibility2 interface contains the OnAddInsUpdate method that occurs when the AddIns collection is updated, unless the add-in is a solution add-in.

Examples

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 

See Also

Reference

EnvDTE Namespace