ContextAttributes.HighPriorityAttributes 속성

High Priority 특성 컬렉션을 가져옵니다.

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

구문

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

속성 값

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

설명

이 특성 컬렉션의 인스턴스는 하나뿐이며 ContextAttributes 컬렉션에서만 사용할 수 있습니다. ContextAttributes 컬렉션이 창에 대한 컬렉션인 경우 HighPriorityAttributes는 값을 반환하지 않습니다.

이 특성들은 항상 유효하며 컨텍스트 모음에서 우선 순위가 가장 높습니다. 그 결과 해당하는 각 범주에서 위쪽의 항목과 일치하게 됩니다.

예제

    Sub HighPriorityAttributesExample()
        Dim cas As EnvDTE.ContextAttributes
        Dim ca As EnvDTE.ContextAttribute

        Try
            cas = DTE.ContextAttributes
            ' List all regular and high priority attributes.
            ListAttr(ca, cas)
            ' Add a new F1 keyword to the global high priority 
            ' attributes collection.
            cas.HighPriorityAttributes.Add("NewAttribute", _
            "NewF1Keyword", vsContextAttributeType. _
            vsContextAttributeLookupF1)
            ListAttr(ca, cas)
            ' Remove the new high priority attribute.
            cas.HighPriorityAttributes.Item(1).Remove()
            ListAttr(ca, cas)
        Catch ex As System.Exception
            MsgBox("ERROR: " & ex.Message)
        End Try
    End Sub

    Function ListAttr(ByVal ca As ContextAttribute, ByVal cas As _
    ContextAttributes)
        Dim msg As String

        Try
            ' List regular attributes, their first value, and their count.
            For Each ca In cas
                msg = msg & ca.Name & "  " & ca.Values(0) & vbCr
            Next
            cas.Refresh()
            MsgBox("All Attributes: " & vbCr & msg & "Count: " & _
            cas.Count)

            ' List high-priority attributes, their first value, 
            ' and their count.
            msg = ""
            For Each ca In cas.HighPriorityAttributes
                msg = msg & ca.Name & "  " & ca.Values(0) & vbCr
            Next
            cas.Refresh()
            MsgBox("High-Priority Attributes: " & vbCr & msg & "Count: " _
            & cas.HighPriorityAttributes.Count)
        Catch ex As System.Exception
            MsgBox("ERROR: " & ex.Message)
        End Try
    End Function

.NET Framework 보안

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

참고 항목

참조

ContextAttributes 인터페이스

EnvDTE 네임스페이스