ConfigurationManager.DTE 속성

최상위 확장성 개체를 가져옵니다.

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

구문

‘선언
ReadOnly Property DTE As DTE
    Get
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
abstract DTE : DTE
function get DTE () : DTE

속성 값

형식: EnvDTE.DTE
DTE 개체입니다.

설명

Visual Studio에서 DTE 개체는 자동화 모델의 루트이며 다른 개체 모델에서는 이를 "Application"이라고도 합니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        ConfigurationManager configmgr;
        Configuration config;
        if (dte.Solution.Projects.Count > 0)
        {
            configmgr = dte.Solution.Projects.Item(1).ConfigurationManager;
            // Return the ActiveConfiguration.
            config = configmgr.ActiveConfiguration;
            // Show how many Configuration objects are in the 
            // Configuration Manager.
            MessageBox.Show(configmgr.Count.ToString());
            // Show the name of the application containing this 
            // Configuration Manager.
            MessageBox.Show(configmgr.DTE.Name);
            // Show the parent object.
            MessageBox.Show(((Project)configmgr.Parent).Name);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

ConfigurationManager 인터페이스

EnvDTE 네임스페이스

기타 리소스

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