public static object GetSingleton(string name) { var candidates = Singletons.Where(x => x.GetType().Name.Contains(name)); if (candidates.Count() == 1) { return(candidates.FirstOrDefault()); } return(null); }