Partager via


Projects.Kind, propriété

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

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

Syntaxe

'Déclaration
ReadOnly Property Kind As String
    Get
string Kind { get; }
property String^ Kind {
    String^ get ();
}
abstract Kind : string
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 bibliothèque de type de langue ou documentation.

Exemples

public void CodeExample(DTE2 dte)
{  
    try
    {   // Open a project before running this sample
        Projects prjs = dte.Solution.Projects;
        string msg = "There are " + prjs.Count.ToString() + " projects in this collection.";
        msg += "\nThe application containing this Projects collection: " + prjs.DTE.Name;
        msg += "\nThe parent object of the Projects collection: " + prjs.Parent.Name;
        msg += "\nThe GUID representing the Projects type: " + prjs.Kind;
        if (prjs.Properties != null)
        {
            msg += "\nProperties:";
            foreach (Property prop in prjs.Properties)
            {
                msg += "\n   " + prop.Name;
            }
        }
        MessageBox.Show(msg, "Projects Collection");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Sécurité .NET Framework

Voir aussi

Référence

Projects Interface

EnvDTE, espace de noms

Autres ressources

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