Add Copyright Header

  • 2 minutes to read

Purpose

Adds a copyright comment at the file's beginning.

Availability

Available when the caret is in the first line of a source code file.

How to Use

  1. Select the CodeRush | Options... item in the Visual Studio's menu and open the IDE | User Info options page.

    CRR_Options

  2. Configure the First Name, Last Name, and Company fields on the User Info options page.

    UserInfo

  3. Open a source code file.

  4. Place the caret at the first line.

  5. Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu and select Add Copyright Header from the menu.

    AddCopyRight

After execution, the Code Provider adds a copyright comment.

    //-----------------------------------------------------------------------
    // <copyright file="D:\Projects\CodeRushDemo\CodeRushDemo\Program.cs" company="Developer Express">
    //     Author: CodeRush User
    //     Copyright (c) Developer Express. All rights reserved.
    // </copyright>
    //-----------------------------------------------------------------------

    using System;
    using System.Collections.Generic;
    // ...

You can also use the h template to add the Copyright Header's text. Refer to the Copyright Header topic for details.

NOTE

This feature is available as a part of Code Cleanup.

See Also