private static EnvironmentConfig Add(
            this EnvironmentConfig config,
            string applicationName,
            string logicalInstanceName,
            string machineName)
        {
            var app = config.Applications.SelectByName(applicationName);
            if (app == null)
            {
                app = new Application(applicationName);
                config.Applications.Add(app);
            }

            var logicalInstance = app.LogicalInstances.SelectByName(logicalInstanceName);
            if (logicalInstance == null)
            {
                logicalInstance = new LogicalInstance(logicalInstanceName);
                app.LogicalInstances.Add(logicalInstance);
            }

            var machine = logicalInstance.Machines.SelectByName(machineName);
            if (machine == null)
            {
                machine = new Machine(machineName);
                logicalInstance.Machines.Add(machine);
            }

            return config;
        }
Пример #2
0
            private static Application CreateApp(
                string name,
                string instanceName,
                params string[] machineNames)
            {
                var app = new Application(name);
                var instance = new LogicalInstance(instanceName);
                foreach (var machineName in machineNames)
                {
                    instance.Machines.Add(new Machine(machineName));
                }

                app.LogicalInstances.Add(instance);

                return app;
            }