Właściwość Configuration.Collection —

Zwraca zawierające kolekcji Configuration wspieranie tej właściwości obiektu.

Przestrzeń nazw:  EnvDTE
Zestaw:  EnvDTE (w EnvDTE.dll)

Składnia

'Deklaracja
ReadOnly Property Collection As ConfigurationManager
ConfigurationManager Collection { get; }
property ConfigurationManager^ Collection {
    ConfigurationManager^ get ();
}
abstract Collection : ConfigurationManager with get
function get Collection () : ConfigurationManager

Wartość właściwości

Typ: EnvDTE.ConfigurationManager
A ConfigurationManager kolekcji.

Przykłady

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

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

Configuration Interfejs

Przestrzeń nazw EnvDTE

Inne zasoby

Porady: kompilowanie i uruchamianie kodu modelu obiektów automatyzacji — przykłady