public static GDIStockObject GetStockObject(StockObjects index) { GDIStockObject anObject; // 1. Lookup the object in the existing stock object table if (gStockObjects.ContainsKey(index)) { anObject = gStockObjects[index]; return anObject; } // 2. create the object if it doesn't exist already anObject = new GDIStockObject(index); gStockObjects.Add(index, anObject); return anObject; }