This documentation is archived and is not being maintained.

HighPriorityAttributes Property

Visual Studio .NET 2003

Returns the High Priority attributes collection.

[Visual Basic .NET]
Public ReadOnly Property HighPriorityAttributes() As ContextAttributes
[Visual Basic 6]
Property Get HighPriorityAttributes() As ContextAttributes
HRESULT __stdcall get_HighPriorityAttributes(
   /* [out, retval] */ ContextAttributes** retVal
ContextAttributes HighPriorityAttributes {get;}
[JScript .NET]
public function get HighPriorityAttributes() : ContextAttributes

Return Value

Returns a ContextAttributes collection.


There is only one instance of this attributes collection. It is available only from Global attribute collection, that is, from the DTE.ContextAttributes collection. If the ContextAttributes collection is for a window, then HighPriorityAttributes returns nothing.

These attributes are always in effect, and they are the highest in the context bag precedence, resulting in matching topics going to the top of their respective categories.


Sub HighPriorityAttributesExample()
   'Get a reference to Solution Explorer.
   Dim SolnEx As Window = DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer)
   Dim CA As ContextAttribute

   ' List the current attributes associated with Solution Explorer.
   ListAttr(SolnEx, CA)

   ' Associate a new F1 keyword with Solution Explorer.
   SolnEx.ContextAttributes.Add("ANewKeyword", 900, vsContextAttributeType.vsContextAttributeLookupF1)
   ListAttr(SolnEx, CA)
   MsgBox("Name of High Priority attributes: " & DTE.ContextAttributes.HighPriorityAttributes.Item(0).Name)
   ' Delete the new F1 keyword from Solution Explorer.
   ListAttr(SolnEx, CA)
End Sub

Sub ListAttr(ByVal SolnEx As Object, ByVal CA As ContextAttribute)
   ' Support function for CATest(). Lists the current attributes    
   ' associated with Solution Explorer.
   Dim msg As String

   MsgBox("Number of context attributes in Solution Explorer: " & SolnEx.ContextAttributes.Count)
   For Each CA In SolnEx.ContextAttributes
      msg = msg & CA.Name & Chr(13)
   msg = ""
End Sub

See Also

Applies To: ContextAttributes Collection