Is there a way to make a single “header” type file in C#?
In C++ you had something like “Mainheader.h” that had all of your includes in it.
Is there a way to do something similar for C# where you had a single file with all of your “using” keywords?
Right now I have a bunch of using such as:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
Is there a way to put them all into a single header file?
Not really. The “mainheader.h” approach worked for C++ because headers are literally textual copy-and-pastes that compilers executed before actually compiling, hence the term “pre-processor directive”.
What you may find useful is to create a template that contains some of your most commonly-used directives. Here’s a link on how to do it in Visual Studio 2010: http://msdn.microsoft.com/en-us/library/6db0hwky.aspx. You can do it in MonoDevelop as well, but it’s a little trickier and involves editing XML directly. Hope this suffices as a workaround.