This should hopefully be an easy question to answer. Basically what I want to know how to do, is how to create an object that can be accessed in any class in the project without having to actually pass it into every single class.
At the moment I'm creating the object in the main form and then passing that object into a class' constructer. When I have one thing that keeps getting passed into a bunch of classes it starts to get confusing. Is there something like an include file in c#.net so that I could just define it in there and use it throughout the project? Is there an easier way to do this?
At the moment I'm creating the object in the main form and then passing that object into a class' constructer. When I have one thing that keeps getting passed into a bunch of classes it starts to get confusing. Is there something like an include file in c#.net so that I could just define it in there and use it throughout the project? Is there an easier way to do this?