Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / June 2007

Tip: Looking for answers? Try searching our database.

How to Group code under one node?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J.Marsch - 22 Jun 2007 00:28 GMT
We are creating a series of classes that will be code generated, but
customizeable by the end user. (we'll use partial classes, where one file is
generated and the other is user-editable).

Since these files will always come in pairs, it would be really nice if I
could group them in the solution explorer, sort of the way that components
or forms are grouped (where you have a parent node, and the child nodes are
code files).

How would I set about doing this?  I have snooped around at the
DesignerCategoryAttribute, and I think I'm getting close, but I haven't
quite cracked the code yet.
WenYuan Wang [MSFT] - 22 Jun 2007 06:10 GMT
Hello J.Marsch,

According to your description, I understand you want to group partial class
just as components or forms does in VS 2005 IDE.

This is a common issue. I'm pretty sure there is no way to do it in UI.
However, it is possible to do by editing the .csproj file directly. In
.csproj file, the value of "DependentUpon" is the file which should be
shown as the parent in solution explorer.
Such as:
<Compile Include="Fun1.1.cs">
       <DependentUpon>Fun1.cs</DependentUpon>
</Compile>
You will notice something as below in solution explorer.
Fun1.cs  
- Fun1.1.cs

For more information, you may refer to:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=642782&SiteID=1
[grouping partial class files like the designer does]

http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/brow
se_thread/thread/554ac3dfbfeda5ac/00143d709269dd02?lnk=st&q=Why+don%27t+part
ial+class+files+group%3F+&rnum=1&hl=zh-CN#00143d709269dd02
[Why don't partial class files group? ]

Hope this helps.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 22 Jun 2007 06:26 GMT
Hi J.Marsch,

BTW, please don't forget to backup your .csproj file before you wan to edit
it.
Thanks.

Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.