다음을 통해 공유


ContextAttributes 인터페이스

업데이트: 2007년 11월

동적 도움말 창의 창 컨텍스트 또는 전역 컨텍스트와 관련된 모든 특성을 포함합니다.

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

구문

<GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")> _
Public Interface ContextAttributes _
    Implements IEnumerable

Dim instance As ContextAttributes
[GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface ContextAttributes : IEnumerable
[GuidAttribute(L"33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface class ContextAttributes : IEnumerable
public interface ContextAttributes extends IEnumerable

설명

DTE.ContextAttributes는 전역 컨텍스트 모음에 영향을 주고 항목을 정렬할 때 우선 순위가 가장 낮습니다.

Window.ContextAttributes는 창의 컨텍스트 모음에 영향을 줍니다. 도구 창의 경우 창에 포커스가 있을 때만 특성이 유효합니다. 편집기와 디자이너의 경우, 편집기가 활성화되어 있는 마지막 MDI 자식 창이라면 이 특성이 유효합니다. HighPriorityAttributes 속성이 true로 설정되어 있으면 특성이 항상 유효하고 우선 순위가 가장 높습니다.

ContextAttributes 컬렉션을 가져온 후에는 ContextAttributes.Refresh 메서드를 호출하여 특성 컬렉션을 최신 상태로 만들어야 합니다. 개체를 페치하는 것만으로는 컬렉션을 최신 상태로 만들 수 없습니다. 그러나 특성을 추가하거나 제거하면 추가 또는 제거 작업의 결과가 최신 상태가 되도록 암시적으로 ContextAttributes 컬렉션이 새로 고쳐집니다.

예제

Sub ContextAttributesExample()
   ' 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)

   ' 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

참고 항목

참조

ContextAttributes 멤버

EnvDTE 네임스페이스