Home › Forums › C# Programming › Global module in C# › Re: Re: Global module in C#
July 10, 2011 at 8:04 pm
#3656
will
Participant
There is no such thing in C# instead you can create a public class in any namespace with Static Members functions like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <br /> namespace GlobalFunctions //You can name it anything you want<br /> {<br /> public class ClassName //Name your class<br /> {<br /> ClassName bers() {} // Constructor for class<br /> public static bool AnyFunction()<br /> {<br /> return true;<br /> }<br /> }<br /> }<br /> <br /> //Use it in Other classes<br /> using GlobalFunctions<br /> bool isTrue = ClassName.anyFunction();<br /> |