Share via


Configuration.Collection 속성

이 속성을 지원하는 Configuration 개체가 들어 있는 컬렉션을 반환합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
ReadOnly Property Collection As ConfigurationManager
ConfigurationManager Collection { get; }
property ConfigurationManager^ Collection {
    ConfigurationManager^ get ();
}
abstract Collection : ConfigurationManager with get
function get Collection () : ConfigurationManager

속성 값

형식: EnvDTE.ConfigurationManager
ConfigurationManager 컬렉션입니다.

예제

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 보안

참고 항목

참조

Configuration 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행