Configuration.Type-Eigenschaft

Ruft eine Konstante ab, die den Objekttyp angibt.

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

Syntax

'Declaration
ReadOnly Property Type As vsConfigurationType
vsConfigurationType Type { get; }
property vsConfigurationType Type {
    vsConfigurationType get ();
}
abstract Type : vsConfigurationType
function get Type () : vsConfigurationType

Eigenschaftswert

Typ: EnvDTE.vsConfigurationType
Eine vsConfigurationType-Konstante, die den Konfigurationstyp angibt.

Hinweise

Type gibt für Konfigurationen eine Konstante zurück, die Angaben darüber enthält, ob die Konfigurationsauflistung eine Konfigurationszeile für einen bestimmten Konfigurationsnamen oder eine Konfigurationsspalte für eine bestimmte Plattform ist.Wenn das Fenster zu einem Umgebungstool gehört, wird es von Type gekennzeichnet.Wenn das Fenster für ein Tool aus einem Toolpaket oder ein Dokumentfenster verwendet wird, lautet Type entweder vsWindowTypeToolWindow oder vsWindowTypeDocument, und die ObjectKind-Eigenschaft enthält paketspezifische Typinformationen.

Beispiele

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        Project prj;
        Configuration config; 
        ConfigurationManager configmgr;
        if (dte.Solution.Projects.Count > 0)
        {
            prj = dte.Solution.Projects.Item(1);
            config = prj.ConfigurationManager.ActiveConfiguration;
            // Returning the Configuration type constant.
            MessageBox.Show(config.Type.ToString());
            // Returns the ConfigurationManager containing the active configuration.
            configmgr = config.Collection;
            // Returns the application containing this active configuration.
            MessageBox.Show(config.DTE.Name);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Configuration Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell