PurplePen.OcadCreation.AddTemplateToMap C# (CSharp) Method

AddTemplateToMap() private method

private AddTemplateToMap ( Map map, TemplateInfo template ) : void
map Map
template TemplateInfo
return void
        void AddTemplateToMap(Map map, TemplateInfo template)
        {
            if (creationSettings.fileFormat.kind == MapFileFormatKind.OCAD && creationSettings.fileFormat.version <= 7) {
                map.Templates = new TemplateInfo[] { template };
            }
            else {
                List<TemplateInfo> templates = new List<TemplateInfo>();
                templates.AddRange(map.Templates);
                templates.Add(template);
                map.Templates = templates;
            }
        }