public Logic() { var anotherClass = new AnotherClass(); MyObjectNames = new List<string>() { "Object01", "Object02", "Object03" }; // either add your names here... MyObjectNames.Add("Object04"); // or add additional names this way //MyObjectNames.AddRange(anotherNameList); // or add another list or use Linq or whatever MyObjectDict = anotherClass.InstantiateAllObjects(MyObjectNames); // objects in dict can be accessed directly by their names: var object01 = MyObjectDict["Object01"]; }
public Logic() { var anotherClass = new AnotherClass(); MyObjectNames = new List <string>() { "Object01", "Object02", "Object03" }; // either add your names here... MyObjectNames.Add("Object04"); // or add additional names this way //MyObjectNames.AddRange(anotherNameList); // or add another list or use Linq or whatever MyObjectList = anotherClass.InstantiateAllObjects(MyObjectNames); }