Freigeben über


ProvideUIContextRuleAttribute Constructor

Definition

Creates a rule based UI context entry that is activated when the expression is evaluated to true

 ProvideUIContextRuleAttribute(std::wstring const & contextGuid, std::wstring const & name, std::wstring const & expression, std::Array <std::wstring const &> const & termNames, std::Array <std::wstring const &> const & termValues, unsigned int delay = 0);
public ProvideUIContextRuleAttribute (string contextGuid, string name, string expression, string[] termNames, string[] termValues, uint delay = 0);
new Microsoft.VisualStudio.Shell.ProvideUIContextRuleAttribute : string * string * string * string[] * string[] * uint32 -> Microsoft.VisualStudio.Shell.ProvideUIContextRuleAttribute
Public Sub New (contextGuid As String, name As String, expression As String, termNames As String(), termValues As String(), Optional delay As UInteger = 0)

Parameters

contextGuid
String

The context GUID.

name
String

The name of the rule.

expression
String

The expression. See Remarks for an example.

termNames
String[]

The names of the terms of the expression.

termValues
String[]

The values of the terms of the expression.

delay
UInt32

The delay.

Remarks

An example rule would be:

ContextGuid: {e551fe48-4b78-4dc4-9ddc-183cbfea7d5b} Expression: VB | CS TermNames: { VB, CS }, TermValues: { ActiveEditorContentType:Basic, ActiveEditorContentType:CSharp } Delay: 500

This would create a new UI context that is activated 500 ms after when active editor is either a C# or VB file

Applies to