public IEnumerable <Chunk> Load(ISparkTemplate template, IFubuApplicationFiles files) { if (template.RelativePath().IsEmpty()) { throw new ArgumentOutOfRangeException("Invalid template path for file " + template.FilePath); } try { var viewLoader = _loaders[files.RootPath]; var chunks = viewLoader.Load(template.RelativePath()); if (chunks == null) { throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath())); } return(chunks.ToList()); } catch (Exception e) { if (e.Message.StartsWith("Unable to parse file")) { throw; } throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath()), e); } }
public IEnumerable<Chunk> Load(ISparkTemplate template, IFubuApplicationFiles files) { if (template.RelativePath().IsEmpty()) { throw new ArgumentOutOfRangeException("Invalid template path for file " + template.FilePath); } try { var viewLoader = _loaders[files.RootPath]; var chunks = viewLoader.Load(template.RelativePath()); if (chunks == null) { throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath())); } return chunks.ToList(); } catch (Exception e) { if (e.Message.StartsWith("Unable to parse file")) throw; throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath()), e); } }
private static void appendMasterPage(SparkViewDescriptor descriptor, ISparkTemplate template) { if (template == null) { return; } descriptor.AddTemplate(template.ViewPath); appendMasterPage(descriptor, template.Master as ISparkTemplate); }
public IEnumerable <Chunk> Load(ISparkTemplate template) { try { var viewLoader = _loaders[template.RootPath]; var chunks = viewLoader.Load(template.RelativePath()); if (chunks == null) { throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath())); } return(chunks.ToList()); } catch (Exception e) { if (e.Message.StartsWith("Unable to parse file")) { throw; } throw new Exception("Unable to parse file '{0}'".ToFormat(template.RelativePath()), e); } }
public void AddBinding(ISparkTemplate template) { _bindings.Add(template); }
public static bool IsSparkView(this ISparkTemplate template) { return(Path.GetExtension(template.FilePath).EqualsIgnoreCase(Constants.DotSpark) || Path.GetExtension(template.FilePath).EqualsIgnoreCase(Constants.DotShade)); }
public static bool IsXml(this ISparkTemplate template) { return(Path.GetExtension(template.FilePath).EqualsIgnoreCase(".xml")); }