Condividi tramite


Proprietà Projects.Kind

Ottiene una stringa di GUID che indica il tipo o il tipo di oggetto.

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

Sintassi

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

Valore proprietà

Tipo: System.String
una stringa di GUID che rappresenta il tipo di oggetto.

Note

Le estensioni dell'ambiente devono fornire le stringhe in modo univoco la definizione del tipo.Queste informazioni devono essere disponibili in ogni strumento o la libreria dei tipi o la documentazione del linguaggio.

Esempi

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);
    }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Projects Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione