C# Partial classes & Solution Explorer - by pdev.mich

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 378781 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 10/30/2008 11:47:47 PM
Access Restriction Public

Description

I think the Solution Explorer window should be smart enough to group partial class files together in the Solution Explorer window; similar to the resx/designer tree it already does for WinForms.

In general, that seems like a good idea, but my specific use case is as follows:

I do a lot of development in C# and have come to love code Region's.  They're a good way to organize your code, but honestly I like partial classes more.  Instead of putting code into Region chunks, I want to separate chunks of logic out into partial classes and then be able to deal with different aspects of the code in a pure form.  There's no problem doing that with todays IDE, other than the excessive amount of .cs files you end up with in the Solution Explorer window.  Dumping these files into folders helps, but its ugly.

(I edited this to add this note: in a lot of cases a need for such separation might imply bad design, but in control development its quite handy)
Sign in to post a comment.
Posted by Microsoft on 11/11/2008 at 2:02 PM
KyleL,

Thank you for your feedback. This is an excellent suggestion. This is very much the way that WinForms and ASP.Net pages seperate out the user code from the designer code.

However, we are currently at the end of our developement cycle. And we do not have time to fit this in. I am going to close this suggestion as "Won't Fix" and we will take a look at it again during out next product cycle.

Thanks,

Chuck England
Visual Studio Platform
Program Manager - Project & Build
Posted by THERAOT on 11/2/2008 at 3:15 PM
I sometimes work in a very diferent way, I group classes in files by their propose, and use namespaces and regions to give order. It has it drawbacks, I know. even if I'm doing wrong, It is posible to have more than a class in a single file, what if you have more than one partial class in the same file? how will you group them?

I vote for Lables in the solution explorer, with automatic labels for partial class. you choose a label, you only see the files of that label. <---

Another way may be have some name convention (i think you have), and add an option to filter files by partial name. <---

Or both. <----