public object GetSingleton(Type t, object[] arguments = null) { object obj = null; try { if (objectPool.ContainsKey(t.Name) == false) { obj = InstanceCreationService.GetInstance().GetNewObject(t, arguments); objectPool.Add(t.Name, obj); } else { obj = objectPool[t.Name]; } } catch { //log ie maybe } return(obj); }
static InstanceCreationService() { instance = new InstanceCreationService(); }