Visual studio displays similar CS files together.

Source: Internet
Author: User

Visual studio displays similar CS files together.

In vs, a new Form will generate three files from1.cs and form1.designer. cs. The designer file is placed at the next level of the first file, which looks very clear about the file structure. In practical applications, we often split a class into several files to ensure that the files are not too long, but these files are arranged in order, which will increase the number of files, not conducive to reading.

 

Folding Method:

1. Find the <Project Name>. csproj file in the project folder and open it in a text editor.

2. Find <Compile Include = "MyClass. part1.cs"/>,

Change
<Compile Include = "MyClass. part1.cs">
<DependentUpon> MyClass. cs </DependentUpon>
</Compile>

, Modify part2 in the same way

3. Save the file and re-open the project.

You will find that the three MyClass files have been folded together.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.