示例#1
0
		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;
		}
示例#2
0
        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));
        }
示例#3
0
		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;
		}
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
			public TemplateItem(FileTemplate template) : base(StringParser.Parse(template.Name))
			{
				this.template = template;
				ImageIndex    = 0;
			}