Share via


FontsAndColorsItems.Item 메서드

FontsAndColorsItems 컬렉션의 ColorableItems 개체를 반환합니다.

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

구문

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

매개 변수

  • index
    형식: Object

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

반환 값

형식: EnvDTE.ColorableItems
ColorableItems 개체

설명

Index에 전달되는 값은 FontsAndColorsItems 컬렉션에 있는 ColorableItems 개체의 인덱스를 나타내는 정수 또는 컬렉션에 있는 ColorableItems 개체를 나타내는 문자열 값입니다.

Item 메서드는 컬렉션에서 인덱스 값에 해당하는 개체를 찾지 못하면 ArgumentException 예외를 throw합니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have an open solution
    try
    {
        Properties props;
        Property prop;
        FontsAndColorsItems fci;
        ColorableItems ci;
        string msg = "";
        props = dte.get_Properties("FontsAndColors", "TextEditor");
        prop = props.Item("FontsAndColorsItems");
        fci = (FontsAndColorsItems)prop.Object;
        ci = fci.Item(1);
        msg += "Count of ColorableItems in fci: " + fci.Count + "\n";
        msg += "The first ColorableItems object in fci is " + ci.Name;
        MessageBox.Show(msg);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

참고 항목

참조

FontsAndColorsItems 인터페이스

EnvDTE 네임스페이스

기타 리소스

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