Пример #1
0
        // Adds a build template instance
        public void AddTemplate(TemplateInstance instance)
        {
            Templates.Add(instance);

            string body = instance.Template.Contents;

            Components = Components
                         .Where(entry => !body.Contains(entry.Key))
                         .ToDictionary(kv => kv.Key, kv => kv.Value);
        }
Пример #2
0
        // Add a template, if the template contains an existing component, remove it
        public void AddTemplate(Template template, List <string> parameters)
        {
            var templateInstance = new TemplateInstance(template, parameters);

            Templates.Add(templateInstance);

            string body = templateInstance.Template.Contents;

            Components = Components
                         .Where(entry => !body.Contains(entry.Key))
                         .ToDictionary(kv => kv.Key, kv => kv.Value);
        }