[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
   Adding a Dictionary for the Spell Checker
  [Expand]Custom Templates Creation
  [Collapse]Context Providers
   Specify a Default Filter for the Jump to Symbol Window
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Context Providers

Contexts are widely used in CodeRush for distinguishing states. The Context can be specified in the following CodeRush features.

  • Templates — you can setup a template to expand only in certain conditions.
  • Shortcuts — you can setup a command to execute only in certain conditions.

The Context is defined with one or several Context Providers combined in a complex expression with the following operators (ordered by priority).

Priority Operator Description Example
1 ( ) Grouping brackets ([InClass] || [InStruct]) && [IsWPF]
2 ! Logical NOT ![OnEmptyLine]
3 && Logical AND [InCodeBlock] && [OnEmptyLine]
4 || Logical OR [InInterface] || [InMethod] || [InProperty]

The Context Providers are separated by the following groups. Refer to the corresponding topic to learn about the Context Providers which belong to the group.

Is this topic helpful?​​​​​​​