The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Tune the Member Organizer

  • 2 min to read

CodeRush Classic Code Cleanup includes the member organization engine. It enables you to group and sort code elements as you need.

The following step-by-step instructions show you how to specify member organization options.

  1. Plan out the way you want to group members.

    For example, you can place member groups in the following order.

    • Constants
    • Private fields
    • Private methods
    • Internal fields
    • Internal methods
    • Public properties
    • Public methods
    • Public events
  2. Open the Rules options page and set focus on the Organize members rule.

    OrganizeMembersRule

    When the Organize members rule is focused, the member organization options become available under the rules list.

  3. Choose the required scope. In this case, Class is the required scope.

    OrganizeMembersChooseClassScope

  4. Click the opRulesAddGroup button to open the Group properties dialog.

    GroupProperties

    Use this dialog to specify options for the new group:

    • Type in the group name.
    • Specify the criteria by which code elements should be organized into the required group.
    • Specify sort order for the elements within the group. For example, order elements by value type name and then by element name.

      Check the required order criteria and move the Return type name criterion to the top of the criteria list using the opRulesMoveGroupUp button.

    • Check the Wrap in region option and specify the region name to wrap the group into a region.
    • Check the Comment before option and specify the comment to insert a comment before the group.

    The following image illustrates the Group properties dialog filled for the "Constants" group.

    ConstantsGroupProperties

  5. Add other groups in the same way, and sort them in the required order. CodeRush Classic places groups in the code in the same order as they are listed on the options page.

    MemberOrganizationGroups

  6. Click OK to apply changes and close the Options Dialog.