Back to Devexpress

How to: Create Regions for Explicit Interface Implementations

coderushforroslyn-401399-getting-started-examples-organize-members-how-to-create-regions-for-explicit-interface-implementations.md

latest1.6 KB
Original Source

How to: Create Regions for Explicit Interface Implementations

  • Apr 13, 2022
  • 2 minutes to read

CodeRush can wrap sorted groups in dynamic regions with built-in variables. This example shows how to wrap explicit interface implementations groups in regions.

Follow the steps below.

  1. Copy the following code and paste it to your project.

  2. Open the Editor | All Languages | Organize Members options page to configure the Member Organization rules feature.

  3. Select the Explicit interface implementations rule from the member organization rules list.

  4. In the “Sort by” section, enable the Wrap distinct groups in regions option to activate wrapping of explicit interface implementations in regions.

  5. Type “{ExplicitInterfaceName} members” in the “Region name” text box.

  6. Click Apply and OK to save changes and close the Organize Members options page.

  7. Switch to the code editor.

  8. Place the caret to any place in the class body.

  9. Press Ctrl + . or Ctrl + ~ to invoke the Code Actions Menu

  10. Choose Organize Members from the list and press Enter.

CodeRush wraps explicit interface implementations in regions and places these regions in the beginning of the class.

See Also

Organize Members Settings