Export (0) Print
Expand All
ID
Top
Expand Minimize

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
[C++]
HRESULT __stdcall get_HighPriorityAttributes(
   /* [out, retval] */ ContextAttributes** retVal
);
[C#]
ContextAttributes HighPriorityAttributes {get;}
[JScript .NET]
public function get HighPriorityAttributes() : ContextAttributes

Return Value

Returns a ContextAttributes collection.

Remarks

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.

Example

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.
   SolnEx.ContextAttributes.Item(3).Remove()
   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)
   Next
   MsgBox(msg)
   msg = ""
End Sub

See Also

Applies To: ContextAttributes Collection

Show:
© 2015 Microsoft