Okay, so working on learning some C#. Great language, love working with it in general, but I'm not understanding how to get over this lack of utility classes. In essence, I want to set up a general utilities class that can be contained in a folder and used for any project simply by doing a "using namespace Globals/Utilities/etc." command. In essence:
using System;
namespace Globals {
public static class Commands {
public static void WaitForReturn() {
Console.WriteLine("Press Enter to continue.");
Console.ReadLine();
}
}
}
Similar to the above, such that in any other class I can call the functions by including it as a preprocessing directive.
using System;
using Globals;
namespace RectangleDemo {
<rectangle definition here>
class Demo {
static void Main(string[] args) {
Rectangle r = new Rectangle();
Rectangle s = new Rectangle(5, 6);
r.Display();
s.Display();
WaitForReturn();
}
}
}
As it is, I'm trying to simply compile my 'utility' class (with more than what is listed above) to check for errors, but it's just telling me that it can't compile it because there's no main method. Any suggestions?
(Yes I'm aware I have a java coding style, I'm okay with that!)