Share via


ContextAttributes 인터페이스

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

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

구문

‘선언
<GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")> _
Public Interface ContextAttributes _
    Inherits IEnumerable
[GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface ContextAttributes : IEnumerable
[GuidAttribute(L"33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface class ContextAttributes : IEnumerable
[<GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")>]
type ContextAttributes =  
    interface
        interface IEnumerable
    end
public interface ContextAttributes extends IEnumerable

ContextAttributes 형식에서는 다음과 같은 멤버를 노출합니다.

속성

  이름 설명
Public 속성 Count ContextAttributes 컬렉션의 개체 수를 나타내는 값을 가져옵니다.
Public 속성 DTE 최상위 확장성 개체를 가져옵니다.
Public 속성 HighPriorityAttributes High Priority 특성 컬렉션을 가져옵니다.
Public 속성 Parent ContextAttributes 컬렉션의 바로 위 부모 개체를 가져옵니다.
Public 속성 Type 개체 형식을 나타내는 상수를 가져옵니다.

위쪽

메서드

  이름 설명
Public 메서드 Add 특성 이름/값 쌍을 ContextAttributes 컬렉션에 추가합니다.
Public 메서드 GetEnumerator() 컬렉션을 반복하는 열거자를 반환합니다. (IEnumerable에서 상속됨)
Public 메서드 GetEnumerator() 컬렉션의 항목에 대한 열거자를 반환합니다.
Public 메서드 Item ContextAttributes 컬렉션의 항목인 ContextAttribute 개체를 반환합니다.
Public 메서드 Refresh 이 특성 컬렉션의 내용을 새로 고칩니다.

위쪽

설명

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

참고 항목

참조

EnvDTE 네임스페이스