Beispiel #1
0
        private static void StartEnvironments(List <Assembly> assemblies, List <string> types)
        {
            List <IEnvironmentLifecycle> environments = new List <IEnvironmentLifecycle>();

            foreach (var typeName in types)
            {
                Type type = null;
                foreach (var assembly in assemblies)
                {
                    type = assembly.GetType(typeName);

                    if (type != null)
                    {
                        break;
                    }
                }

                if (type == null)
                {
                    Console.WriteLine("ERROR: Failed to load {0}", typeName);
                    return;
                }
                else
                {
                    Console.WriteLine("Loading environments for {0}", typeName);

                    environments.Add(Environments.ForType(type));
                }
            }

            StartEnvironments(environments);
        }