Forgot global variables in .NET, there is no such thing; and this is only for good. You need to get rid of such way of thinking, instead of trying to find a workaround for this. Global variables are never needed, period.
However, sometimes you need functionality which you used to have with global variables; and there is a special pattern called
singleton:
http://en.wikipedia.org/wiki/Singleton_pattern[
^].
A good implementation is shown here:
http://csharpindepth.com/Articles/General/Singleton.aspx[
^].
I saw a number of really bad implementations, so pay a special attention for this article in every detail: this is really good.
But even the singleton is often overused by some, so, always start with thinking of the solution not using any; use the singleton only if it is absolutely necessary, as a last resort.
—SA