tags:

views:

42

answers:

2

I was wondering if its possible to change the default "program" class that gets created for any console application to a partial class.

I want to do this because I want better organisation rather than have all methods in 1 file categorized by region. It would make more sense for me to have certain method categories sitting in separate files.

My understanding of a partial class is that it is a class definition in multiple files that during a compile merges the class files into 1 class unit.

I could be wrong, or there could be a better way for me to achieve better organisational structure. Any suggestions would help, and thanks

+1  A: 

You certainly can do that - but it sounds to me like you'd be better off splitting your code into multiple classes. If you've got multiple method "categories" those categories may well be natural class boundaries.

Generally speaking, the entry point class should be fairly small. That's not always the case, but it's a good rule of thumb. Usually its only purpose is to get the rest of the program running.

Jon Skeet
+1  A: 

"Guidance Automation Toolkit" and "Guidance Automation Extension" provide option to extend the File -> New -> Project options and you can generate the code the way you like. You can use this only if you want to create initial code automatically while creating projects.

One example for Guidance Package is SmartClient Library (CAB+EL). Smartclient source code is available.

It is good to have separate files for single class. One example based on CAB/Composite Appliacation Block or Windows form application.

there would be view.cs and view.designer.cs and both are defining the same file. view.designer.cs is used specifically for GUI designer where developer normally won't edit. Developer edit view.cs.

Gopalakrishnan Subramani