다음을 통해 공유


Configurations.Item 메서드

Configurations 컬렉션의 Configuration 개체를 반환합니다.

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

구문

‘선언
Function Item ( _
    index As Object _
) As Configuration
Configuration Item(
    Object index
)
Configuration^ Item(
    [InAttribute] Object^ index
)
abstract Item : 
        index:Object -> Configuration
function Item(
    index : Object
) : Configuration

매개 변수

  • index
    형식: Object

    필수입니다. 반환할 Configuration 개체의 인덱스입니다.

반환 값

형식: EnvDTE.Configuration
Configuration 개체

설명

index에 전달되는 값은 Configurations 컬렉션에 있는 Configuration 개체에 대한 정수 또는 컬렉션에 있는 Configuration 개체의 이름입니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{   
    try
    {   // Make sure you have a solution loaded into Visual Studio
        // before running the following example. Make sure the "Any CPU" 
        // option is marked in the Configuration Manager dialog box.
        Configurations configs = null;
        if (dte.Solution.Projects.Count > 0)
        {
            configs = dte.Solution.Projects.Item(1).ConfigurationManager.Platform("Any CPU");
            // Show the configuration name of the first item in 
            // the Configurations collection.
            MessageBox.Show(configs.Item(1).ConfigurationName);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

참고 항목

참조

Configurations 인터페이스

EnvDTE 네임스페이스

기타 리소스

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