We have an application, n-tier like structured, but I wouldn't say it's n-tiered. The top most Form /AKA MainForm/ connects to a DB and gets a list of available modules, according to which it starts loading different modules. Each module is a separate project having 1 top level class that derives from an abstract class, from which all modules derive.
So on and on, so far we have everything running just fine, passing around connections strings, dialogs between modules and the main app.
the next step is to implement a global icon library that each module is to use, the catch is that each module should be able to load its own images to it.
I'm thinking of a global static class that returns currently running instance of ImageList class. I don't know where to start with that, so could anyone please provide an example of global Class that could be used statically without the need of declaring or passing it around? is it possible at all?
EDIT:
rephrase attempt: ideally a global resource to which each separate module is able to insert resources, out of which each module is able to get images if they exist. I don't even know where to start or what to look for.
EDIT 2:
just checked:
had 3 projects: 1 main, 1 child, 1 inbetween
main references inbetween
child references inbetween
1 main starts and calls static methods on "inbetween" loading some strings into it. Using Reflection "main" instance loads child.dll and instantiates the object using the reflection, then calls a method defined in an interface in "inbetween" on the child obj which in turn calls the static method on the "inbetween" after which "main" prints all the strings in the static "inbetween". And it works! I was like WTF? I guess Reflection combines the 2 "inbetweens"
public static class Foo
{
public static int Bar()
{
return 1;
}
public static void AddImage(Image img, String key){...}
public static Image GetImage(String key){...}
}