I have a Lazy object whos Value has a constructor that I need to call.
But I can't find a way to do it with out initializing the class at least once using a default constructor.
After creating the value once, I can create a new one like above, but I would like to change it to make it so we don't have a useless image in memory...Code:if (plugin.IsValueCreated) { return Activator.CreateInstance(plugin.Value.GetType(), parameters); } else { //I need to figure out how to initilize the value with parameters.. return Activator.CreateInstance(plugin.Value.GetType(), parameters); }




Reply With Quote