-
-
Save yannduran/3203b76a5b2d68bd83d8f5085f20973c to your computer and use it in GitHub Desktop.
Shows how to add custom UIContexts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On the package | |
[ProvideAutoLoad(UIContexts.LoadContext)] | |
[ProvideUIContextRule(UIContexts.LoadContext, | |
"RightFileTypeOpen", | |
"(CSharpFileOpen | VBFileOpen)", | |
new[] { "CSharpFileOpen", "VBFileOpen" }, | |
new[] { "ActiveEditorContentType:CSharp", "ActiveEditorContentType:Basic" })] | |
In the VSCT | |
<VisibilityConstraints> | |
<VisibilityItem guid="guidCmdSet" id="cmdidStuff" context=" guidLoadContext " /> | |
</VisibilityConstraints> | |
<Symbols> | |
<GuidSymbol name="guidLoadContext" value="{C6216099-CA25-4821-A541-044E82B4DCF1}" /> | |
</Symbols> | |
As a helper containing the GUIDs | |
namespace Foo | |
{ | |
internal static class UIContexts | |
{ | |
public const string LoadContext = "C6216099-CA25-4821-A541-044E82B4DCF1"; | |
} | |
} | |
Bolded GUIDs must match | |
Docs on allowed conditions: https://msdn.microsoft.com/en-us/library/mt750411.aspx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment