[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
 [Collapse]Coding Assistance
  [Expand]Code Templates
  [Expand]Auto Completion
  [Expand]Clipboard Tools
  [Collapse]Selection Tools
   [Collapse]Selection Embedding
     C# and Visual Basic Embeddings
     XAML Embeddings
    Camel Case Selection
    Comment/Uncomment Selection
    Selection Expand/Reduce
    Include Previous/Next Element
    Smart Duplicate Selection
  [Expand]Code Providers
  [Expand]Declare Menu
  [Expand]Typing Helpers
 [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
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Selection Embedding

The Selection Embedding feature allows you to surround a piece of code with a boilerplate block (for instance, try..catch). CodeRush provides predefined embeddings for C#, Visual Basic, and XAML.

You can embed one or more lines of code.

  • Select code and press Ctrl + . or Ctrl + ~ to invoke the quick actions menu.

  • Open the Embed Selection group and choose the embedding from the list.

Expanded Enable One-Key Selection Embedding Shortcuts

Do one of the following to enable one-key embedding shortcuts:

  • Refer to the Selection | Embedding group in the shortcuts configuration.

  • Use the Setup Wizard page. Choose CodeRush | Setup Wizard... menu item to invoke this page.

Expanded Customize Selection Embedding

You can configure the Selection Embedding feature in the Editor | All Languages | Selection Embeddings options page.

CodeRush allows you to edit an existing embedding selection (for example, change the embedding style and modify empty lines).

You can also add a new selection embedding.

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