Beispiel #1
0
		public string CompileScript(FileTemplateImpl 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(FileTemplateImpl 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);
        }