Back to Devexpress

Declare Partial Class Part/Partial Record Part

coderushforroslyn-401382-refactoring-assistance-declare-partial-class-part-record-part.md

latest1.0 KB
Original Source

Declare Partial Class Part/Partial Record Part

  • Dec 10, 2021

Purpose

Creates a class part/record part in a new file and makes the current class/record partial.

You can use the Declare Partial Class Part/Declare Partial Record Part refactoring in C# projects that contain file-scoped namespace declarations.

Availability

Available when the cursor is in a class or partial class for the “Declare Partial Class Part” refactoring.

The “Declare Partial Record Part” refactoring is available when the cursor is in a record or partial record.

How to Use

  1. Place the caret in a class or partial class/record or partial record.

  2. Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.

  3. Select Declare Partial Class Part / Declare Partial Record Part from the menu.

After execution, this refactoring makes the current class/record partial and creates a file with the new part of this class/record.