Newbie: separate big .cs file into small .cs files 
Author Message
 Newbie: separate big .cs file into small .cs files

Hi: All

My Form1.cs file is getting bigger, so I want to break it
into several smaller .cs files, just like in vc++: include
a .h file in main.cpp file, and add sub1.cpp, sub2.cpp..
to store functions or data.

How to do that in C#?

Thanks.

JT



Fri, 24 Jun 2005 07:09:49 GMT  
 Newbie: separate big .cs file into small .cs files


Quote:
> Hi: All

> My Form1.cs file is getting bigger, so I want to break it
> into several smaller .cs files, just like in vc++: include
> a .h file in main.cpp file, and add sub1.cpp, sub2.cpp..
> to store functions or data.

> How to do that in C#?

Types (classes) cannot span more than one file in .NET 1.x.

One of the planned features for .NET 2.x is types spanning
multiple files.

This, however, is a standard object-oriented problem.

You shouldn't have that much code in one class under normal
circumstances. You should think about breaking your functionality
into chunks and moving those chunks into classes.

-c



Fri, 24 Jun 2005 09:20:34 GMT  
 Newbie: separate big .cs file into small .cs files


Wed, 18 Jun 1902 08:00:00 GMT  
 Newbie: separate big .cs file into small .cs files
Thanks Chad, that help.

I am going to using different classes.

JT

Quote:
>-----Original Message-----
>Hi: All

>My Form1.cs file is getting bigger, so I want to break it
>into several smaller .cs files, just like in vc++:
include
>a .h file in main.cpp file, and add sub1.cpp, sub2.cpp..
>to store functions or data.

>How to do that in C#?

>Thanks.

>JT
>.



Fri, 24 Jun 2005 07:52:29 GMT  
 Newbie: separate big .cs file into small .cs files


Wed, 18 Jun 1902 08:00:00 GMT  
 Newbie: separate big .cs file into small .cs files
Hi: C

Thanks for the email, after got your email, I waw
trying to move my 8 picuterBoxes into another class,
but there are a lot of difficulties and problems I
couldn't solve.  (ie: communication between my main Form
with those pictureBoxes..)

Do you have any easy to follow tutorial, web site, or
sample code to teach newbie how to seperate a big .cs file
into several classes?

Thank you very much.

JT

Quote:
>-----Original Message-----



>> Hi: All

>> My Form1.cs file is getting bigger, so I want to break
it
>> into several smaller .cs files, just like in vc++:
include
>> a .h file in main.cpp file, and add sub1.cpp, sub2.cpp..
>> to store functions or data.

>> How to do that in C#?

>Types (classes) cannot span more than one file in .NET
1.x.

>One of the planned features for .NET 2.x is types spanning
>multiple files.

>This, however, is a standard object-oriented problem.

>You shouldn't have that much code in one class under
normal
>circumstances. You should think about breaking your
functionality
>into chunks and moving those chunks into classes.

>-c

>.



Fri, 24 Jun 2005 23:55:33 GMT  
 Newbie: separate big .cs file into small .cs files
I don't have any good links right now, sorry.
I'm sure someone else does and will post promptly.

This is a standard OOP design question. You have
lots of functionality and you have to break it down,
but how?

The first question you need to answer is:

- What does my app do?

Then, you need to start thinking about breaking it
down into units of functionality.

Without knowing more about what you're doing, I
can only give general responses.

-c


Quote:
> Hi: C

> Thanks for the email, after got your email, I waw
> trying to move my 8 picuterBoxes into another class,
> but there are a lot of difficulties and problems I
> couldn't solve.  (ie: communication between my main Form
> with those pictureBoxes..)

> Do you have any easy to follow tutorial, web site, or
> sample code to teach newbie how to seperate a big .cs file
> into several classes?

> Thank you very much.

> JT

> >-----Original Message-----



> >> Hi: All

> >> My Form1.cs file is getting bigger, so I want to break
> it
> >> into several smaller .cs files, just like in vc++:
> include
> >> a .h file in main.cpp file, and add sub1.cpp, sub2.cpp..
> >> to store functions or data.

> >> How to do that in C#?

> >Types (classes) cannot span more than one file in .NET
> 1.x.

> >One of the planned features for .NET 2.x is types spanning
> >multiple files.

> >This, however, is a standard object-oriented problem.

> >You shouldn't have that much code in one class under
> normal
> >circumstances. You should think about breaking your
> functionality
> >into chunks and moving those chunks into classes.

> >-c

> >.



Sat, 25 Jun 2005 00:19:49 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. resx files needed for cs - files ??

2. CS files display in VS6 like CPP files ?

3. Include code in other Cs files

4. Reuse of cs files, namespace, arch advice pls

5. How to Generate .cs file at Runtime

6. Two CS files (using namespaces)

7. My .cs files were deleted!?

8. manipulating server controls in the Codebehind .cs file

9. *.~cs files

10. Custom Class.cs default file

11. Printing .cs files

12. File format at ftp.cs.su.oz.au

 

 
Powered by phpBB® Forum Software