internal static List <object> SingletonSearch(string input) { var instances = new List <object>(); var nameFilter = ""; if (!string.IsNullOrEmpty(input)) { nameFilter = input; } var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) { // Search all non-static, non-enum classes. foreach (var type in asm.TryGetTypes().Where(it => !(it.IsSealed && it.IsAbstract) && !it.IsEnum)) { try { if (!string.IsNullOrEmpty(nameFilter) && !type.FullName.ContainsIgnoreCase(nameFilter)) { continue; } ReflectionUtility.FindSingleton(instanceNames, type, flags, instances); } catch { } } } return(instances); }