次の方法で共有


ContextAttributes.HighPriorityAttributes プロパティ

更新 : 2007 年 11 月

High Priority 属性コレクションを取得します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
ReadOnly Property HighPriorityAttributes As ContextAttributes
'使用
Dim instance As ContextAttributes
Dim value As ContextAttributes

value = instance.HighPriorityAttributes
ContextAttributes HighPriorityAttributes { get; }
property ContextAttributes^ HighPriorityAttributes {
    ContextAttributes^ get ();
}
function get HighPriorityAttributes () : ContextAttributes

プロパティ値

型 : EnvDTE.ContextAttributes

ContextAttributes コレクション。

解説

この属性コレクションのインスタンスは 1 つだけです。このインスタンスは、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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

ContextAttributes インターフェイス

ContextAttributes メンバ

EnvDTE 名前空間