private string ParseImports(IHasImports entity)
 {
     return(string.Join("", entity.GetImportRecords().Select(a =>
                                                             _importTemplate.Clone().ToString()
                                                             .Replace("$moduleNames$", a.ElementTypeName)
                                                             .Replace("$relativePaths$", "./" + a.RelativeNamespace))));
 }
Exemple #2
0
        public static IEnumerable <ImportRecord> GetImportRecords(this IHasImports element)
        {
            var records = element.Imports.Where(a => a != element.Uri).Select(a => new ImportRecord
            {
                RelativeNamespace = element.Uri.MakeRelativeUri(a),
                ElementTypeName   = a.Segments.Last()
            });

            return(records);
        }