Example #1
0
 public void AddChild(IRenderableElement element)
 {
     _children.Add(element);
     if (element is IUpdateableElement)
     {
         _updateableChildren.Add(element as IUpdateableElement);
     }
 }
        private void DoRender(IRenderableElement entity, string template, string fileName = null)
        {
            var ns = entity.NameSpace.Replace('.', Path.DirectorySeparatorChar);

            if (fileName == null)
            {
                fileName = entity.Name;
            }

            if (entity is IHasImports imports)
            {
                template = template.Replace("$imports$", ParseImports(imports));
            }

            template = template
                       .Replace("$EntityType$", entity.Name)
                       .Replace("$Name$", entity.Name)
                       .Replace("$NameSpace$", entity.NameSpace);

            File.WriteAllText($"{_outFolder}\\{ns}\\{fileName}.ts", template);
        }
Example #3
0
 public void RemoveChild(IRenderableElement element)
 {
     _children.Remove(element);
     _updateableChildren.Remove(element as IUpdateableElement);
 }