Window.ContextAttributes 속성

자동화 클라이언트가 동적 도움말 창에서 현재 선택된 항목에 새 특성을 추가하고 이 특성에 대한 상황에 맞는 도움말을 제공할 수 있도록 하는 ContextAttributes 컬렉션을 가져옵니다.

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

구문

‘선언
ReadOnly Property ContextAttributes As ContextAttributes
ContextAttributes ContextAttributes { get; }
property ContextAttributes^ ContextAttributes {
    ContextAttributes^ get ();
}
abstract ContextAttributes : ContextAttributes with get
function get ContextAttributes () : ContextAttributes

속성 값

형식: EnvDTE.ContextAttributes
ContextAttributes 컬렉션입니다.

예제

Sub ContextAttributesExample(ByVal dte As DTE2)

    ' List the current context attributes associated with 
    ' Solution Explorer.
    Dim explorerWin As Window = dte.ToolWindows.SolutionExplorer.Parent
    Dim attrs As String
    Dim attr As ContextAttribute

    For Each attr In explorerWin.ContextAttributes
        attrs &= attr.Name & vbCrLf
    Next

    MsgBox("Solution Explorer has the following context attributes:" _
        & vbCrLf & vbCrLf & attrs)

    ' Associate a new F1 keyword with Solution Explorer.
    explorerWin.ContextAttributes.Add("ANewKeyword", "900", _
        vsContextAttributeType.vsContextAttributeLookupF1)

    attrs = ""
    For Each attr In explorerWin.ContextAttributes
        attrs &= attr.Name & vbCrLf
    Next

    MsgBox("Solution Explorer has the following context attributes:" _
        & vbCrLf & vbCrLf & attrs)

End Sub
public void ContextAttributeExample(DTE2 dte)
{
    // List the current context attributes associated with 
    // Solution Explorer.
    Window explorerWin = dte.ToolWindows.SolutionExplorer.Parent;
    string attrs = "";

    foreach (ContextAttribute attr in explorerWin.ContextAttributes)
        attrs += attr.Name + "\n";

    MessageBox.Show(
        "Solution Explorer has the following context attributes:\n\n" + 
        attrs);

    // Associate a new F1 keyword with Solution Explorer.
    explorerWin.ContextAttributes.Add("ANewKeyword", "900", 
        vsContextAttributeType.vsContextAttributeLookupF1);

    attrs = "";
    foreach (ContextAttribute attr in explorerWin.ContextAttributes)
        attrs += attr.Name + "\n";

    MessageBox.Show(
        "Solution Explorer has the following context attributes:\n\n" + 
        attrs);
}

.NET Framework 보안

참고 항목

참조

Window 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행