ProjectItem.Kind, propriété

Mise à jour : novembre 2007

Obtient une chaîne GUID indiquant le genre ou le type de l'objet.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

ReadOnly Property Kind As String

Dim instance As ProjectItem
Dim value As String

value = instance.Kind
string Kind { get; }
property String^ Kind {
    String^ get ();
}
function get Kind () : String

Valeur de propriété

Type : System.String

Chaîne GUID représentant le type de l'objet.

Notes

Les extensions d'environnement doivent fournir des chaînes de type définies de façon unique. Ces informations doivent être disponibles dans chaque outil, ou dans la bibliothèque de types ou la documentation du langage.

Exemples

Sub KindExample2(ByVal dte As DTE2)

    ' Before running this example, open a project.

    Dim proj As Project = dte.Solution.Projects.Item(1)
    Dim item As ProjectItem
    Dim msg As String

    For Each item In proj.ProjectItems
        msg &= "    " & item.Name & _
            "  [Kind = " & item.Kind & "]" & vbCrLf
    Next

    MsgBox(proj.Name & "  [Kind = " & proj.Kind & _
        "] has the following project items:" & vbCrLf & vbCrLf & msg)
End Sub
public void KindExample2(DTE2 dte)
{
    // Before running this example, open a project.

    Project proj = dte.Solution.Projects.Item(1);
    string msg = "";

    foreach (ProjectItem item in proj.ProjectItems)
        msg += "    " + item.Name + "  [Kind = " + item.Kind + "]\n";

    MessageBox.Show(proj.Name + "  [Kind = " + proj.Kind + 
        "] has the following project items:\n\n" + msg); 
}

Autorisations

Voir aussi

Référence

ProjectItem, interface

Membres ProjectItem

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation