public string CompileScript(FileTemplate item, FileDescriptionTemplate file) { if (file.Content == null) throw new ArgumentException("file must have textual content"); Match m = scriptRegex.Match(file.Content); m = m.NextMatch(); if (m.Success) { this.item = item; this.file = file; return CompileAndGetOutput(GenerateCode()); } return file.Content; }
int IComparable.CompareTo(object other) { FileTemplate pt = other as FileTemplate; if (pt == null) { return(-1); } int res = category.CompareTo(pt.category); if (res != 0) { return(res); } return(name.CompareTo(pt.name)); }
public string CompileScript(FileTemplate item, FileDescriptionTemplate file) { if (file.Content == null) throw new ArgumentException("file must have textual content"); Match m = scriptRegex.Match(file.Content); // A file must have at least two "<% %>" segments to be recognized as script. // I consider this a bug, but we'll keep it for backwards compatibility; // at least until the ScriptRunner gets replaced by something more sane. m = m.NextMatch(); if (m.Success) { this.item = item; this.file = file; return CompileAndGetOutput(GenerateCode()); } return file.Content; }
public string CompileScript(FileTemplate item, FileDescriptionTemplate file) { if (file.Content == null) { throw new ArgumentException("file must have textual content"); } Match m = scriptRegex.Match(file.Content); m = m.NextMatch(); if (m.Success) { this.item = item; this.file = file; return(CompileAndGetOutput(GenerateCode())); } return(file.Content); }
public string CompileScript(FileTemplate item, FileDescriptionTemplate file) { if (file.Content == null) { throw new ArgumentException("file must have textual content"); } Match m = scriptRegex.Match(file.Content); // A file must have at least two "<% %>" segments to be recognized as script. // I consider this a bug, but we'll keep it for backwards compatibility; // at least until the ScriptRunner gets replaced by something more sane. m = m.NextMatch(); if (m.Success) { this.item = item; this.file = file; return(CompileAndGetOutput(GenerateCode())); } return(file.Content); }
public TemplateItem(FileTemplate template) : base(StringParser.Parse(template.Name)) { this.template = template; ImageIndex = 0; }