Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Add Class from Clipboard
Add Class from Clipboard

Add Class from Clipboard

Preview

Yevhen Cherkes

|
43 installs
| (0) | Free
Adds new class from clipboard with name identified from content.
Download

Stand With Ukraine

Add Class From Clipboard

Overview

This Visual Studio extension lets developers quickly create a new C# class (interface, enum, or delegate) file from the clipboard text content, and now also copy the contents of selected files to the clipboard. It's a very useful tool for pasting code from github, gists, code samples, source code generated by LLMs, or quickly copying file contents.


Features

  • Add Class From Clipboard:

    • Quickly create a new C# class, interface, enum, or delegate file from clipboard content.
    • Placement:
      • In the Project menu
      • In the Solution Explorer context menu under "Add."
    • Automatic Class Naming:
      • Extracts the class name from the clipboard content to name the new file appropriately.
    • Keyboard Shortcut:
      • Quickly invoke the command with Ctrl + E, Ctrl + V.
  • Copy File Contents (New!):

    • Copy the contents of selected files (or all files in selected projects/folders) to the clipboard, concatenated with line breaks.
    • Placement:
      • In the Solution Explorer context menu for files, folders, and projects.
    • Useful for quickly sharing or reusing code from multiple files.

How to Use

Add Class From Clipboard

  1. Copy valid C# code containing a class (interface, enum, delegate) declaration to your clipboard.
  2. In Visual Studio:
    • Right-click a folder in Solution Explorer, navigate to Add, and select "Add Class From Clipboard."
    • Or, open the Project menu and select "Add Class From Clipboard."
  3. The extension will:
    • Parse the clipboard content.
    • Extract the class name.
    • Create a .cs file named after the type in the selected folder.
  4. No file will be created if a valid type name cannot be extracted.

Copy File Contents

  1. In Solution Explorer, select one or more files, folders, or projects.
  2. Right-click and choose Copy File Contents from the context menu.
  3. The contents of all selected files (recursively, for folders/projects) will be copied to the clipboard, separated by blank lines.

Contributing

Contributions are welcome! To contribute:

  1. Clone the repository.
  2. Make changes or add new features.
  3. Submit a pull request for review.

License

This project is licensed under the MIT License.


Contact

For issues or feature requests, please open an issue on the GitHub repository.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft