Proprietà Solution3.AddIns

ottiene AddIns raccolta, che contiene tutti i componenti aggiuntivi attualmente disponibile associato alla soluzione.

Spazio dei nomi:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

Sintassi

'Dichiarazione
ReadOnly Property AddIns As AddIns
AddIns AddIns { get; }
property AddIns^ AddIns {
    AddIns^ get ();
}
abstract AddIns : AddIns
function get AddIns () : AddIns

Valore proprietà

Tipo: EnvDTE.AddIns
AddIns raccolta.

Note

Solo i componenti aggiuntivi registrato viene visualizzato in AddIns la raccolta e che caricano e scaricare quando la soluzione viene caricato e scaricato da.

Esempi

Per informazioni su come eseguire il codice del componente aggiuntivo, vedere Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione.

Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    Solution3Example(_applicationObject)
End Sub

Sub Solution3Example(ByVal dte As DTE2)
    ' This function creates a solution and adds a Visual C# Console
    ' project to it.
    Try
        Dim soln As Solution3 = CType(DTE.Solution, Solution3)
        Dim csTemplatePath As String
        ' This path must exist on your computer.
        ' Replace <file path> below with an actual path.
        Dim csPrjPath As String = "<file path>"
        MsgBox("starting")
        ' Get the project template path for a C# console project.
        csTemplatePath = CType(soln.GetProjectTemplate _
        ("ConsoleApplication.zip", "CSharp"), string)
        ' Create a new C# Console project using the template obtained 
        ' above.
        soln.AddFromTemplate(csTemplatePath, csPrjPath, _
        "New CSharp Console Project", False)
        MsgBox("done")
    Catch ex As System.Exception
        MsgBox(ex.ToString)
    End Try
End Sub
using System.Windows.Forms;
public void OnConnection(object application,
 Extensibility.ext_ConnectMode connectMode, object addInInst,
 ref System.Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    // Pass the applicationObject member variable to the code example.
    Solution3Example((DTE2)_applicationObject);
}

public void Solution3Example(DTE2 dte)
{
    // This function creates a solution and adds a Visual C# Console
    // project to it.
    try{
        Solution3 soln = (Solution3)_applicationObject.Solution;
        String csTemplatePath;
        // The file path must exist on your computer.
        // Replace <file path> below with an actual path.
        String csPrjPath = "<file path>";
        "<file path>MessageBox.Show("Starting...");
        "<file path>"<file path>csTemplatePath = 
        soln.GetProjectTemplate("ConsoleApplication.zip", "CSharp");
        // Create a new C# Console project using the template obtained 
        // above.
        soln.AddFromTemplate(csTemplatePath, csPrjPath,
          "New CSharp Console Project", false);
        MessageBox.Show("Done!");
    }
    catch(SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Solution3 Interfaccia

Overload AddIns

Spazio dei nomi EnvDTE90