Code Modularization - Visual C# .net

Status
Not open for further replies.

bassist695

Seniorius Lurkius
1
I'm working with C# for the first time (as many others are), and recall from past experience with VB6 that you can put often-used code into a module so that it is available to all classes.

In the application I'm working on, we have tons of code that is reused by different forms within the application. Is there a similar functionality in Visual C# .net? It would really help to clean up our code and make troubleshooting a LOT easier.

Thanks a lot,
Mike :confused:
 

enkafan

Wise, Aged Ars Veteran
111
if you are moving from VB6 to C#, remember that EVERYTHING in C# is in a class.

If you want to make a subroutine in C# work like a one in a VB6 standard module (.bas), then mark the routine as static. That way, you won't have to create an instance of the class to use the routine (static routines are generally only used for library type routines like this).

You also might want to check out Brian Bishoff's (spelling?) .NET Translation Guide book published by APress. It has a quick translation between VB6, VB.NET and C#. Here is the publishers site for the book: http://www.apress.com/book/bookDisplay.html?bID=80

I'd check out the sample chapter they have available. It actually covers this topic i believe...
 
Status
Not open for further replies.