I come today with a weird question. Is there a way where I can use a non static class like static?
I.e: We have the following classes:
public class Parameters { public String LoadType { get; set; } public Parameters (String inLoadType) { LoadType = inLoadType; } } public class MainClass { public Parameters Parameters { get; set; } public MainClass(String inLoadType) { Parameters = new Parameters(inLoadType); } } Now we instantiate MainClass, then somewhere in another place that is not the MainClass I would like to access to the LoadType.
It should be threadSafe, also the operation take quite long, that is the reason I cannot simply just use a lock and make it static.
The class where I want to access that variable is static, I thought in a workaround with a static Event in the Parameters class, and whoever call the event would get the value of the instantiated class or something like that. Any other Ideas about it beside passing as parameter to the static method what I need?
Sounds like stupid question but I just want to know if is possible or not.