Export (0) Print
Expand All

Window.ContextAttributes Property

Gets a ContextAttributes collection which allows automation clients to add new attributes to the current selected items in the Dynamic Help window and provide contextual help for the additional attributes.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

ContextAttributes ContextAttributes { get; }

Property Value

Type: EnvDTE.ContextAttributes
A ContextAttributes collection.

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);
}

Community Additions

ADD
Show:
© 2014 Microsoft