What is the C# equiv to Module?

bri189a

Well-known member
Joined
Sep 11, 2003
Messages
1,004
Location
VA
I work with classes... what is this Module stuff? I thought that would of went away with VB6... a module isnt a class... are people using this in VB? Should they be? I wouldnt think so.
 
I wouldve hoped that they wouldve done away with Modules in vb.net but thats not the case. I dont think there is an equivalant in C#. Thank god.
 
if you really cant avoid something "module-like" I would suggest using a class with static variables and methods

Code:
public class MyClass
{
   public static int GlobalVariable;
   private static int testProperty;

   public static void ShowMessage(string message)
   {
       Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " -> " + message);
       MessageBox.Show(message);
   }

   public static int TestProperty
   {
      get{return testProperty;}
      set{testProperty = value;}
   }
}

but we have the prossiblity to write object oriented code - so why stick to the old concepts?

Andreas
 
Thanks guys, just wanted to make sure its worthless before I waste time looking at it.
 
Back
Top