Partilhar via


AddIns.Add Method

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.

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

Syntax

'Declaration
Function Add ( _
    ProgID As String, _
    Description As String, _
    Name As String, _
    Connected As Boolean _
) As AddIn
AddIn Add(
    string ProgID,
    string Description,
    string Name,
    bool Connected
)
AddIn^ Add(
    String^ ProgID, 
    String^ Description, 
    String^ Name, 
    bool Connected
)
abstract Add : 
        ProgID:string * 
        Description:string * 
        Name:string * 
        Connected:bool -> AddIn
function Add(
    ProgID : String, 
    Description : String, 
    Name : String, 
    Connected : boolean
) : AddIn

Parameters

  • ProgID
    Type: System.String

    Required. The ProgID of the add-in to add to the collection.

  • Description
    Type: System.String

    Required. A description for the add-in to add to the collection.

  • Name
    Type: System.String

    Required. The name of the add-in to add to the collection.

  • Connected
    Type: System.Boolean

    Required. Indicates whether the add-in is currently loaded.

Return Value

Type: EnvDTE.AddIn
An AddIn object.

Examples

Sub AddExample()
   ' 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

   addincoll = DTE.AddIns
   addinobj = addincoll.Item(1)

   ' Activates a solution add-in so that it is available.
   addinobj = DTE.Solution.AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False)
End Sub

.NET Framework Security

See Also

Reference

AddIns Interface

EnvDTE Namespace